I am new to Python and I understand this might be a naive question but I am so confused:
My question is what is the difference between line 13 and 24 in the image below? I want to see a value of something, when should I use print()
and when just having the value will print it? for example, in line 13 if I don't put the print
there, it doesn't show me the value. However the exact same thing in line 24 it will show me the value.
the same thing about type
, when should I use it this way :print(type(a))
to see the type on the screen and when type(a)
will be sufficient to see the type?
Is there a problem with the site that I am practicing with or is there something deeper that I am missing?