Question

"Python strings are immutable" Explain in details what is that mean. Provide examples of strings in...

"Python strings are immutable" Explain in details what is that mean. Provide examples of strings in Python and how it can be used

Homework Answers

Answer #1

Strings are immutable means once we create the string we can't change the data in the string that is called immutable.

t= "Hello"
print(t)
#here you will get an error 
#because we can't chagne the data of string object
t[0] = "M"

In Python Strings are sequence of characters. we use strings with ""

h = "Hello World" #here we have created a string

print(h) #here we are printing the string

print(h[0]) # here we are printing the first char in the string

h="Hello World"
print(h) #prints complete string
print(h[0]) #prints 1st char
print(h[2:5]) #prints between 2 to 5

NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.

Please Like and Support me as it helps me a lot

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write about strings and input in python. Explain with 2 examples.
Write about strings and input in python. Explain with 2 examples.
What does it mean to be responsive in the Age of Responsibility? Provide examples, and explain...
What does it mean to be responsive in the Age of Responsibility? Provide examples, and explain the trade-off between responsiveness and scalability
Explain with full details and examples, what are the sources of ethics? What are the sources...
Explain with full details and examples, what are the sources of ethics? What are the sources of morals?
Malicious attacks can be random or directed. Explain in details ?with an examples
Malicious attacks can be random or directed. Explain in details ?with an examples
What does it mean to provide a multidimensional approach? Provide at least three examples of how...
What does it mean to provide a multidimensional approach? Provide at least three examples of how the care team can meet the patient and the family’s needs? List at least three care team members and how are they involved in providing multidimensional care?
Provide explanation about Iterations (python). Give examples and write a program.
Provide explanation about Iterations (python). Give examples and write a program.
About python: Explain what is Polymorphism and provide a code snippet
About python: Explain what is Polymorphism and provide a code snippet
Explain the mechanism of allosteric regulation and provide examples how this mechanism can be used to...
Explain the mechanism of allosteric regulation and provide examples how this mechanism can be used to tune the flow of molecules in a metabolic pathway.
Write a Python function first_chars that takes one parameter, which is a nested list of strings....
Write a Python function first_chars that takes one parameter, which is a nested list of strings. It returns a string containing the first character of all of the non-empty strings (at whatever depth they occur in the nested list) concatenated together. Here are a couple of examples of how the function should behave when you're done: >>> first_chars(['Boo', 'is', 'happy', 'today']) 'Biht' >>>first_chars(['boo', 'was', ['sleeping', 'deeply'], 'that', 'night', ['as', ['usual']]]) 'bwsdtnau'
Compare and contrast growth and regulation in insects versus humans. Provide relevant details and examples to...
Compare and contrast growth and regulation in insects versus humans. Provide relevant details and examples to support your answer.