

Python Lesson Discussion 2-26-2025
Presentation
•
Computers
•
12th Grade
•
Easy
Steve Howard
Used 2+ times
FREE Resource
32 Slides • 22 Questions
1
2
3
4
Dropdown
5
6
Dropdown
7
8
9
Dropdown
10
Multiple Choice
What will this code print?
<class 'str'>
str
greeting
Hello world
11
12
Multiple Choice
What will this print?
<class 'int'>
int
50
my_number
13
You can use the type function to determine a variable's type.It gives you a little more than you need to know, but you can find the type in single quotes after the word class.
14
15
Match
Match definitions with statements
variable = value
type(element)
print(“text”)
Assigns a value to a variable name
Determines the type of an element
Prints entered text
Assigns a value to a variable name
Determines the type of an element
Prints entered text
16
Multiple Choice
What type is the following variable?
x = "Hi there"
float
integer
boolean
string
17
Multiple Choice
What does the following Python program print?
I am 6 feet tall
I am6feet tall
I am
6
feet tall
x
y
z
18
19
20
Labeling
Label the statement
The prompt
function to receive input from user
variable name
21
22
Dropdown
23
24
Multiple Choice
What will this statement print?
Age: 22
22
<class 'str'>
Age:
22
text
25
26
Multiple Choice
How to correct this?
number = int(input("Number: "))
print(number + 1)
number = print(number + 1)
print(number + 1)
27
28
29
30
Multiple Choice
On which line will this program call an error in the console?
1
2
3
4
31
Line 2 will product the error. You cannot divide a str by an integer. You need to convert the user's input to an int.
32
33
Multiple Choice
Suppose you run the following Python program:
x = input("Enter some text: ") print(x)
While the program is running, after the prompt has been printed, the user types the following and presses Enter:
Delaware ratified the U.S. Constitution in 1787.
What does the program print?
Delaware ratified the U.S. Constitution in 1787.
Delaware ratified the U.S. Constitution in
Delaware
(The program does not print anything.)
34
35
36
Multiple Choice
What does the following Python program print?
x = 12 % 4
print(x)
0
1
3
4
37
The modulus operator gives the remainder when dividing two values. Because 4 divides 12 evenly, there is no remainder, so 12 % 4 gives a value of 0.
38
Multiple Choice
What does the following Python program print?
x = 9 + 6 / 3 * 2 - 1
print(x)
9
15
21
12
39
Python follows the order of operations so it divides 6/3 first (which equals 2), then multiplies 2*2 (which is 4), then adds 9 + 4 (which is 13) and then subtracts 1 (which is 12).
40
41
42
Dropdown
43
44
Multiple Choice
How do you correct this?
print("a" + str(3))
print("a" + 3))
str(3))
45
You can convert the integer into a string using the str function before adding it to a string.
46
47
Multiple Choice
Which of the following Python programs will not run?
48
Python cannot concatenate variables of different types!
49
Multiple Choice
Which of the following is NOT a program that will produce the following output?
hellohellohello
50
This code will print ‘hello’ each on a separate line
51
52
Multiple Choice
Which of the following is NOT a valid type of comment in Python?
%% This is a comment
# This is a comment
" " "
This is a comment
" " "
53
Great work! We can only use “”” for multiline comments and # for in-line comments.
54
Multiple Choice
Which of the following best describes the main purpose of comments?
Comments create better spacing in programs.
Comments describe your program so other people can read it more easily.
Comments warn the people running the program about potential problems with the program.
Show answer
Auto Play
Slide 1 / 54
SLIDE
Similar Resources on Wayground
48 questions
องค์ประกอบของคอมพิวเตอร์
Presentation
•
University
43 questions
ตัวดำเนินการบูลีน แก้ไขจากคุณ Narin Sintharom
Presentation
•
KG
50 questions
Inglés I
Presentation
•
12th Grade
44 questions
7.05 & 7.06
Presentation
•
12th Grade
49 questions
Note Taking Refresher
Presentation
•
12th Grade
48 questions
Functional Physical Science FINAL REVIEW
Presentation
•
KG - 12th 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