+ 1
Unknown
animal = “lion” animal = “zebra” Print(animal) I can’t understand ?
7 ответов
+ 4
You can learn python here
https://www.sololearn.com/Course/Python/?ref=app
+ 3
We can store something using variable. animal is a variable. So we will print the value using print( animal )
+ 1
You must use ", not slanted `
p of print must not be capitalized.
https://code.sololearn.com/c0JSGT4P9c5I/?ref=app
+ 1
thanks you brother
+ 1
Imagine you are writing a program that tells visitors where animals are in a zoo. First you ask them to pick their location. If they choose area1, then the program will say lion. If area2, then zebra. If area3, maybe penguins or whatever. The “location” and “animal” variables are just names that your program uses, so that it can describe the connections between many locations and many animals. Does this help?
+ 1
animal = "lion"
assigns animal variable to string "lion", after this where ever you use animal variable you would get the string "lion".
animal = "zebra"
reassigns the animal variable to string "zebra", the old string "lion' will be ignored.
Where ever you use animal variable you would now get the string "lion".
print(animal)
Prints the latest value of variable animal "zebra".
Output would be:
zebra
+ 1
First of all, Python is case sensitive so you need to write print instead of Print. And when you declare variable with same name multiple times. It takes the value that was given lastly. For eg:
A=1
A=2
A=3
Here the value of A becomes 3 because it 3 was declared at last