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 :: python function to do comparison between two numbers 
Python :: python string operations 
Python :: dataframe cut 
Python :: selenium python get image from url 
Python :: Numpy split array into chunks of equal size 
Python :: infinite for loop in python 
Python :: odd number in python 
Python :: python scatter size 
Python :: gui with pygame 
Python :: how to make spinning donut on python 
Python :: python array spread 
Python :: python bigquery example 
Python :: get ip python 
Python :: python 3.5 release date 
Python :: reverse linked list python 
Python :: python list to sublists 
Python :: remove last element in list python 
Python :: how to print the 3erd character of an input in python 
Python :: python loop function 
Python :: expand figure matplotlib 
Python :: show only lower diagonal in sns pairplot 
Python :: traduce query model 
Python :: bash: line 1: templates/addtask.html: No such file or directory in flask app 
Python :: max(X_train, key=len).split() 
Python :: gnome-terminal stopped executing after python 3.6 is installed 
Shell :: conda install tqdm 
Shell :: restart postgres ubuntu 
Shell :: delete files with a certain extension recursively 
Shell :: how to get current git branch 
Shell :: install netstat ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =