Python Print Exercises
Let’s check out some exercises that will help understand Python’s print function better.
Let's start with a long time programming tradition and print "Hello World!" by typing it inside print() function.
However, to save you the anxiety, and in case you really must, it's here. But try not to look, seriously.
Now try to assign "Hello World!" to the variable my_text.
Make sure, variable (my_text) is on the left side of the equation. and your string is in quotes while assigning it to my_text, like this: “Hello World!”
When printing a variable with print function you shouldn’t use quotes. But if you’re printing a string directly with print() function then you should.
Exercising is a great way to improve skills and gain confidence. Especially with language studies, repetition and consistent practices are proven ways to success, this is no different for computer languages. We highly suggest progressive repetition if you are a student of Python.
Speaking of fun, it is also one of the major keys to sustainable practice. If you enjoy what you’re doing everything will be much easier than it would be otherwise.
Check out plenty of exercises, tutorials and other resources we have prepared for you to navigate through this exciting journey.