Cannot use string twice?


#1

The string was given a variable z, but z could not be used twice to print same string?

Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are



z=print("Twinkle, twinkle, little star,\n \t\t How I wonder what you are!")
z
print("\t\t\t\t Up above the world so high,\n \t\t\t\t Like a diamond in the sky.")
z

#Edition: Although this line of code worked-
z="Twinkle, twinkle, little star,\n \t\t How I wonder what you are!"
print(z)
print("\t\t\t\t Up above the world so high,\n \t\t\t\t Like a diamond in the sky.")
print(z)


Can someone explain to me what happened here?


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.