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!"

Need More Exercises?

Check out Holy Python AI+ for amazing Python learning tools.

*Includes 14 more programming languages, inspirational tools and 1-on-1 consulting options.
Umut Sagir
Finance & Data Science Professional,
Founder of HolyPython

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.

“Have you installed Python yet?”
Having Python setup on your computer can expedite the learning experience and help you gain the real life skills in a non-simulation environment. Installing Python can have different nuances that can be confusing for everyone. We compiled a complete tutorial about the best and most convenient Python installing practices Check it out by clicking the button below.