how to type variable in string in python w3 code example
Example 1: {} string python
txt1 = "My name is {fname}, I'm {age}".format(fname = "John", age = 36)
txt2 = "My name is {0}, I'm {1}".format("John",36)
txt3 = "My name is {}, I'm {}".format("John",36)
Example 2: python string tutorial
print("Hello\nworld")
print("I want to type \"Hello world\" but I can't")
phrase = "Hello World"
print(phrase)
print(phrase.upper())
print(len(phrase))
print(phrase[0])
print(phrase.index("e"))
print(phrase.index("llo"))