Search Header Logo
Basic Python Part 1 Review

Basic Python Part 1 Review

Assessment

Presentation

Computers

12th Grade

Practice Problem

Easy

Created by

Catherine L Hulcher

Used 3+ times

FREE Resource

31 Slides • 28 Questions

1

media

2

media

3

media

4

Labelling

Label the command

Drag labels to their correct position on the image

command to display text

Text must be enclosed by quotes

anything displayed in parentheses

5

Multiple Choice

Which Python code segment will display “Hello, world!” on the screen?

1

display Hello, world!

2

print "Hello, world!"

3

"Hello, world!"

4

print("Hello, world!")

6

Multiple Choice

Question image

What does the following Python code display?

1
2
3

7

media

8

Dropdown

A
is something that
in a program so that it can be used later.

9

media

10

media

11

media

12

Dropdown

A
whose type is
contains text, or a sequence of zero or more characters - letters, numbers, punctuation, spaces, etc.


13

media

14

media

15

Dropdown

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



16

media

17

Dropdown

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


18

media

19

media

20

Dropdown

A
is created and updated in Python using an
.


21

media

22

Labelling

Label the statement

Drag labels to their correct position on the image

variable name

value

assignment operator

23

media

24

Multiple Choice

Question image

What will this code print?

1

<class 'str'>

2

str

3

greeting

4

Hello world

25

media

26

Multiple Choice

Question image

What will this print?

1

<class 'int'>

2

int

3

50

4

my_number

27

media

28

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

29

Multiple Choice

What type is the following variable?

x = "Hi there"

1

float

2

integer

3

boolean

4

string

30

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

31

media

32

media

33

Labelling

Label the statement

Drag labels to their correct position on the image

variable name

function to receive input from user

The prompt

34

Dropdown

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


35

media

36

Multiple Choice

Question image

What will this statement print?

1

Age: 22

22

<class 'str'>


2

Age:

3

22

4

text

37

media

38

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)

39

media

40

media

41

media

42

Multiple Choice

Question image

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

1

1

2

2

3

3

4

4

43

media

44

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.)

45

media

46

media

47

Multiple Choice

What does the following Python program print?

x = 12 % 4

print(x)

1

0

2

1

3

3

4

4

48

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

49

media

50

media

51

Dropdown

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

52

media

53

Multiple Choice

Question image

How do you correct this?

1

print("a" + str(3))

2

print("a" + 3))

3

str(3))

54

media

55

Multiple Choice

Which of the following Python programs will not run?

1
2
3
4

56

Multiple Choice

Which of the following is NOT a program that will produce the following output?

hellohellohello

1
2
3
4

57

media

58

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

" " "

59

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 / 59

SLIDE