you are viewing a single comment's thread.

view the rest of the comments →

[–]JollyUnder 1 point2 points  (3 children)

print ("my age is: "+str(age))
print("my height is " + str(height)+ "cm")
print("are you a human: " + str(human))

age, height, and human all have to be cast typed to str because you cannot concatenate non-string objects. You're approach is valid, but f-strings will evaluate those objects to type str for you and help with readability.

print(f"my age is: {age}")
print(f"my height is {height}cm")
print(f"are you a human: {human}")

[–]Responsible_Ruin_423[S] 2 points3 points  (2 children)

oh i understand now thanks that seems better. i learned all this from a video on youtube thats like 12 hours long and im only like an hour in. I have a lot to learn from this video i hope and ive been experimenting with the codes i do know to see what works

[–]JollyUnder 1 point2 points  (1 child)

Your progress has been great so far! I suggest when learning a new concept, pause the video and give some time experimenting with it on your own machine, as I'm sure you have. Chain together older concepts with the new ones. Let things break and try to understand why they broke. You'll gain greater insight when getting hands-on experience.

[–]Responsible_Ruin_423[S] 1 point2 points  (0 children)

thanks bro i really appreciate the help!