Search Header Logo
Python Lesson Discussion 2-26-2025

Python Lesson Discussion 2-26-2025

Assessment

Presentation

Computers

12th Grade

Easy

Created by

Steven Howard

Used 2+ times

FREE Resource

32 Slides • 22 Questions

1

media

2

media

3

media

4

Dropdown

A
whose type is
contains a number. The number can be positive, negative, or zero. It cannot have a



5

media

6

Dropdown

is short for
. It is similar to an integer, except it
have a decimal component.


7

media

8

media

9

Dropdown

A
is created and updated in Python using an
.


10

Multiple Choice

Question image

What will this code print?

1

<class 'str'>

2

str

3

greeting

4

Hello world

11

media

12

Multiple Choice

Question image

What will this print?

1

<class 'int'>

2

int

3

50

4

my_number

13

Explanation Slide...

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

media

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

16

Multiple Choice

What type is the following variable?

x = "Hi there"

1

float

2

integer

3

boolean

4

string

17

Multiple Choice

Question image

What does the following Python program print?

1

I am 6 feet tall

2

I am6feet tall

3

I am
6
feet tall

4

x
y
z

18

media

19

media

20

Labelling

Label the statement

Drag labels to their correct position on the image

The prompt

function to receive input from user

variable name

21

Explanation Slide...

media

22

Dropdown

When using the input function, the program
on the first line until the user presses the enter key.


23

media

24

Multiple Choice

Question image

What will this statement print?

1

Age: 22

22

<class 'str'>


2

Age:

3

22

4

text

25

media

26

Multiple Choice

Question image

How to correct this?

1

number = int(input("Number: "))

print(number + 1)


2

number = print(number + 1)

3

print(number + 1)

27

media

28

media

29

media

30

Multiple Choice

Question image

On which line will this program call an error in the console?

1

1

2

2

3

3

4

4

31

Explanation Slide...

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

media

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?

1

Delaware ratified the U.S. Constitution in 1787.

2

Delaware ratified the U.S. Constitution in

3

Delaware

4

(The program does not print anything.)

34

media

35

media

36

Multiple Choice

What does the following Python program print?

x = 12 % 4

print(x)

1

0

2

1

3

3

4

4

37

Explanation Slide...

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)

1

9

2

15

3

21

4

12

39

Explanation Slide...

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

media

41

media

42

Dropdown

Adding two strings together is called
. When you concatenate two strings, you put them side by side.

43

media

44

Multiple Choice

Question image

How do you correct this?

1

print("a" + str(3))

2

print("a" + 3))

3

str(3))

45

Explanation Slide...

You can convert the integer into a string using the str function before adding it to a string.

46

media

47

Multiple Choice

Which of the following Python programs will not run?

1
2
3
4

48

Explanation Slide...

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

1
2
3
4

50

Explanation Slide...

This code will print ‘hello’ each on a separate line

51

media

52

Multiple Choice

Which of the following is NOT a valid type of comment in Python?

1

%% This is a comment

2

# This is a comment

3

" " "

This is a comment

" " "

53

Explanation Slide...

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?

1

Comments create better spacing in programs.

2

Comments describe your program so other people can read it more easily.

3

Comments warn the people running the program about potential problems with the program.

media

Show answer

Auto Play

Slide 1 / 54

SLIDE