Python.
Download Python 3.3.5 x64 bit
Download Pyscripter 2.5 x64 bit
Lesson 1.
Printing to the page
print(3, "This is the number 3")
print(3, " This is the number 3", 15+9)
Maths
- subtract
+ addition
*multiplication
/ division
print(3*412)
Printing things 5 times
print ("Andy" *5)
print ("Andy\n" *5)
Name variable
name= input("What's your name?")
print(name,"is a lovely name")
Exercise Hints
Exercise 1.
Real numbers 3.8
String number 3.8
Booleon numbers are True and False
Perform Arithmetics.
Exercise 2.
% is for formatting.
%.2f% = 2 decimal places
%.3f% = 3 decimal places
Exercise 3.
While loop to repeat things
== is equal to .
.
Banner program.
#ask the user for their name
name=input("Please enter your name")
#dashes
print("-" *(len(name)+6))
print(".: " +name+ " :.")
#print the second row of dashes
print("-" *(len(name)+6))
Start
Get Name
Prepare Banner
Output Banner
End
Teaching Ideas.
Agbonline Teaching Exercises.
Using python.com
20 code Challenges( complete for GCSE 9-1 )
Python Exercises.
Introduction to Python
Python exercises