
Python Programming Homework 1
Presentation
•
Computers
•
6th - 9th Grade
•
Medium
Kevin Moore
Used 274+ times
FREE Resource
3 Slides • 13 Questions
1
2
You may have encountered the word 'variable' in Science or Maths.
In programming a variable is a container for storing data (in memory) - the data stored can be changed whilst the program is running.
We can assign values to variables directly or we can get data from user input
3
Multiple Choice
Which of the following is an example of a variable in Python?
print("hello")
age=13
input("Enter your age")
type()
4
Fill in the Blanks
The contents of a variable can be changed while the
Type answer...
5
Multiple Choice
a = 10
b=5
b=a+5
print(b)
What would be printed to the screen in this example?
5
10
105
15
6
Multiple Choice
a = 10
b=5
b=a+5
print(a)
What would be printed to the screen in this example?
5
10
105
15
7
Multiple Choice
a = 10
b=5
b=a+5
print(a+b)
What would be printed to the screen in this example?
5
10
25
15
8
In lesson 2 we looked at count-controlled loops (FOR loops). loops are also known as Iteration.
A For loop allows us to repeat an instruction a set number of times.
Remember the Happy Birthday program you wrote in the lesson? You used a for loop to control the output of the song - it also saved you having to repeat lines of code.
9
Multiple Choice
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
10
Multiple Choice
This loop can only be used when the programmer knows the number of times a code is to be repeated
while
for
do while
repeat until
11
Multiple Choice
Which kind of loop would be used?
I need a revision program that will run through revision questions 4 times.
FOR Loop
WHILE Loop
12
Multiple Choice
In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works
13
Multiple Choice
Why is iteration important?
It determines the order in which instructions are carried out
It allows code to be simplified by removing duplicated steps
It allows multiple paths through a program
It ensures the code works correctly
14
Multiple Choice
Look at the following code, what will it generate
1,2,3,4,5,6,7,8,9,10,11,12
0,1,2,3,4,5,6,7,8,9,10,11,12
1,2,3,4,5,6,7,8,9,10,11,12,13
0,1,2,3,4,5,6,7,8,9,10,11,12,13
15
Multiple Choice
What does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
16
Multiple Choice
What does the program display as its output?
1,2,3,4
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
12 questions
K.1 Media Balance is Important
Presentation
•
KG
14 questions
Cyber Safety
Presentation
•
5th - 10th Grade
11 questions
Ôn tập học kì 1 lớp 4
Presentation
•
KG
11 questions
Symbolism
Presentation
•
6th - 8th Grade
11 questions
Presentation Skills
Presentation
•
5th - 9th Grade
11 questions
rational vs. irrational numbers
Presentation
•
6th - 9th Grade
10 questions
Dichotomous Keys
Presentation
•
6th - 9th Grade
10 questions
Additive and Multiplicative Relationships
Presentation
•
6th - 9th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
32 questions
Unit 3: Intro to App Design (APCSP 22-23, Code.org)
Quiz
•
9th - 12th Grade
43 questions
Computer & Internet Basics
Quiz
•
6th Grade
31 questions
Computer Basics Review-2
Quiz
•
6th Grade
30 questions
[AP CSP] Spreadsheets Review
Quiz
•
9th Grade
10 questions
Digital Citizenship: Part 1
Quiz
•
6th - 8th Grade
15 questions
AP CSP - Code.org Unit 3 Review
Quiz
•
9th - 12th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade