Beruflich Dokumente
Kultur Dokumente
ython
Name:
Use this booklet to summarise what you have learnt each week.
Week 1
Two modes are available to programmer if they want to enter Python code.
mode
mode
Today, you will have learnt about using the print() statement. If a new programmer
was starting out to learn Python, give three pieces of advice you would offer:
1)
2)
3)
Which of the following 3 statements is correct?
(i)
(ii)
PRINT(Welcome to Dalriada)
print(Welcome to Dalriada)
(iii)
print(Welcome to Dalriada)
Week 2
(i)
What is a variable?
(ii)
print(Welcome to Dalriada)
aName = input()
print(Nice to meet you)
anAge = input()
(iii)
Variable_Name
Assignment
Data
sign.
Show how to assign the following values to the following variables in Python.
a. Assign the value 45 to a variable called aNumber.
Week 3
(i)
Python Syntax
Addition
Subtraction
Division
Multiplication
(ii)
(iii)
Print(Welcome to Dalriada)
aName = input
print(Nice to meet you aName)
4
Week 4
(i)
First statement
Or
Second Phrase
Equal to == ?
(ii)
==
aName
Mary
aMonth
January
100
100
(iii)
Week 5
Look at the code below:
print("What is 2 + 2?")
answer = input ()
(i)
print("What is 2 + 2?")
answer = input ()
answer = int(answer)
(ii)
score = 0
print("What is 2 + 2?")
answer = input ()
answer = int(answer)
if answer == 4:
print("Well done")
score = score + 1
else:
print("Sorry the answer was 4")
(iii)
Week 6
Look at the following statements below:
If score > 80 then Output Grade A.
If score > 70 then Output Grade B.
If score > 60 then Output Grade C ELSE Output Grade D.
(i)
What would the above instructions look like in Python? Write your Python
code below:
(ii)
You have learnt lots of syntax rules when coding in Python. Can you think of
5 pieces of advice you could give to a new programmer who is learning to
code in Python? List them below:
a.
b.
c.
d.
e.