I am out of trial and error again Lists
python at mrabarnett.plus.com
Sat Oct 25 02:20:53 CEST 2014
On 2014-10-25 00:57, Seymore4Head wrote:
> Wait! I don't get it.
> print (name)
> print (b)
> I forgot the b
If you print the int 1, you'll see:
If you print the string "1", you'll see:
Normally you want it to print only the characters of the string. Think
how annoying it would be if every time you printed a string it appeared
>>> print("Hello world!")
How could you print just the text:
No, it's better that it prints the characters of the string.
One function you can use is repr:
x = 1
y = "1"
This will print:
OK, now it's clear that x is an int and y is a string.
More information about the Python-list