Python Print Exercises

Let’s check out some exercises that will help understand Python’s print function better.

Exercise 1-a

Let's start with a long time programming tradition and print "Hello World!" by typing it inside print() function.


Exercise 1-b

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.

my_text="Hello World!"
print(my_text)

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.