code: tu01 points: 10
PRINTING
The first line nearly everybody does when they start a new language is the classic Hello World. So let's do it!
print ("Hello World!")
Notice in Python 3 we have to put this inside the brackets!
print ("Hello World!")
Notice in Python 3 we have to put this inside the brackets!
Exercise 1: Print your own phrase
Basic Maths
By putting the speech marks inside Print we are telling the computer that this is a string. However computers are the world's greatest calculating machines so it's just as easy for it to do basic calculations. Try this easy one:
print (5*5)
It didn't actually print 5*5, but 25 right?
You can use a wide range of Maths in Python, but for now try the following:
+ Addition
- Subtraction
* Multiplication
/ Division
** Power (exponentiation)
print (5*5)
It didn't actually print 5*5, but 25 right?
You can use a wide range of Maths in Python, but for now try the following:
+ Addition
- Subtraction
* Multiplication
/ Division
** Power (exponentiation)
Exercise 2: Try doing the most complicated Maths you can in your head and compare it to the answers you get from the computer.
Exercise 3: Try 22/7 What do you get?
Exercise 3: Try 22/7 What do you get?