
Python Programming Homework 1
Presentation
•
Computers
•
6th - 9th Grade
•
Medium
Kevin Moore
Used 272+ times
FREE Resource
3 Slides • 13 Questions
1
Python Programming Homework 1
2
What is a variable?
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
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
What is iteration?
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
Python Programming Homework 1
Show answer
Auto Play
Slide 1 / 16
SLIDE
Similar Resources on Wayground
11 questions
Treasure Island Chapters 1-3
Presentation
•
6th - 8th Grade
11 questions
Newton's Laws
Presentation
•
6th - 8th Grade
12 questions
4 Intrare/Ieșire - Tipuri de date
Presentation
•
5th - 9th Grade
11 questions
Appropriate Use of Technology
Presentation
•
6th - 8th Grade
14 questions
Elements of Game Design in Game Star Mechanics (with Scrolling)
Presentation
•
7th - 8th Grade
10 questions
Coding in Kindergarten 2023
Presentation
•
KG
11 questions
Fall of Rome
Presentation
•
6th - 8th Grade
11 questions
Author's Argument
Presentation
•
6th - 8th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
7 questions
Warm Up 04.01.2026
Quiz
•
9th Grade
20 questions
Revising & Editing practice
Quiz
•
7th Grade
10 questions
Box Plots
Quiz
•
6th - 7th Grade
8 questions
Amoeba Sister Asexual vs Sexual Reproduction
Interactive video
•
8th Grade
10 questions
April Fool's Day Pranks and Tips
Interactive video
•
3rd - 6th Grade