s1 = "Hello" s2 = 'World' print(s1, s2)
print("I'm learning Python") print('She said "Hi!" to me')
\
print("First line\nSecond line") print("He said: \"Python is fun!\"")
poem = """Roses are red, Violets are blue.""" print(poem)
word = "Python" print(word[0]) # P print(word[-1]) # n print(word[0:3]) # Pyt
text = "hello" # text[0] = "H" Error text = "H" + text[1:] print(text) # Hello
msg = "Python" print(len(msg)) # 6 print(min(msg)) # 'P' print(max(msg)) # 'y'
s = "hello world" print(s.upper()) # HELLO WORLD print(s.lower()) # hello world print(s.find("world")) # 6 print(s.replace("world", "Python"))
"I love programming"
programming
Python