"> ");
100%
LESSONS & TOPICS

Exercises Introduction to Python & Variables

Exercises Introduction to Python & Variables

 

Exercises

Use either an IDLE window or the python windows just below the exercises.

Exercise 1

Run the following code by pressing the triangle button. Study the print instructions one by one and try to understand how they work.

 

Exercise 2

Create a variable with the name firstWord and assign the value: Hello in it. Then create a second variable named secondWord and assign the value: world. Now use those two variables you have just created to print out the text: Hello World

 

Exercise 3

Take the sentence:

Python is incredible. I love it!.

Store each word in a separate variable, then print out the sentence on one line using print function.

 

Exercise 4

First, assign your name into name variable, your last name into last_name variable and your age into age variable. Then print on the screen the following text:

Mick Jagger is 71 years old

Of course name, last name and age have to contain your information.