
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
13 questions
2.02 Cover Letter
Presentation
•
6th - 8th Grade
13 questions
Intro to Keyboarding
Presentation
•
7th - 8th Grade
11 questions
Teenager 5 Session 22: Pronunciation & Speaking
Presentation
•
KG
14 questions
The History of Computers, Part 1
Presentation
•
5th - 9th Grade
12 questions
Pre-Algebra SOL 8.4 and 8.9 SOL Prep
Presentation
•
6th - 9th Grade
13 questions
Motion
Presentation
•
6th - 9th Grade
10 questions
K.3 Safety in My Online Neighborhood
Presentation
•
KG
10 questions
บทเรียนวิชาคอมพิวเตอร์พื้นฐาน
Presentation
•
KG
Popular Resources on Wayground
10 questions
How much do you know about our Portrait of an Eagle?
Quiz
•
10th Grade
10 questions
Fast Food Slogans
Quiz
•
6th - 8th 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
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
Copyright and Fair Use
Quiz
•
6th - 8th Grade
20 questions
[AP CSP] Python Coding: Functions, Parameters, Return
Presentation
•
9th - 12th Grade
15 questions
Internet Safety
Quiz
•
7th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade
20 questions
APCS Unit 1A
Quiz
•
9th - 12th Grade
28 questions
STEM: Engineering Design Process
Quiz
•
5th - 6th Grade
24 questions
Binary
Quiz
•
9th - 12th Grade