Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

strings are immutable in python

fruit = 'Banana'
fruit[0] = 'b'
# This will give us
# TypeError: 'str' object does not support item assignment
# That means we cannot change the original string
# But we can do the following
x = fruit.lower()
# The original string doesn't change, and we get only a copy of fruit
print(x)
Comment

python string: immutable string

#Python-д мөр нь өөрчлөгддөггүй. 
# Энэ нь нэг мөр тодорхойлогдсон бол түүнийг өөрчлөх боломжгүй гэсэн үг. 
# Мөрт хувиргах арга байхгүй. 
# Энэ нь жагсаалт гэх мэт өгөгдлийн төрлөөс ялгаатай бөгөөд тэдгээрийг үүсгэсний дараа өөрчлөх боломжтой.
Comment

PREVIOUS NEXT
Code Example
Python :: how to make label background transparent in tkinter 
Python :: add two datetime python 
Python :: json to base64 python 
Python :: check input in python 
Python :: delete pandas column 
Python :: create new list in for loop python 
Python :: how to use the random module in python 
Python :: fibonacci number in python 
Python :: Print a specific value of dictionary 
Python :: change column name pandas 
Python :: django objects.create() 
Python :: qlistwidget item clicked event pyqt 
Python :: how to open an image in opencv 
Python :: median of a list in python 
Python :: for loop with index python3 
Python :: numpy inverse square root 
Python :: python file count 
Python :: enum python 
Python :: how to find which 2 rows of a df are the most similar 
Python :: get ContentType with django get_model 
Python :: python - remove columns with same name and keep first 
Python :: create list of numbers 
Python :: templateDoesNotExist Django 
Python :: spawn shell using python 
Python :: how to find the last item of a list 
Python :: python list comprehension cartesian product 
Python :: color name to hex python 
Python :: get columns by type pandas 
Python :: python how to keep turtle window open 
Python :: python how to count number of true 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =