Search Header Logo
Printing and Variables Lesson

Printing and Variables Lesson

Assessment

Presentation

Computers

9th Grade

Practice Problem

Medium

Created by

Daniel Clark

Used 3+ times

FREE Resource

8 Slides • 10 Questions

1

media

Printing, Variables, and Variable Types

2

media

Use the print function (i.e. print ())

  • must have parentheses ()

  • must have double quotation marks, "Hello"

  • must begin with the word print​

How to Print or Display Text

3

Multiple Choice

When printing in python, you must have the following?

1

the word 'print'

2

double quotation marks

3

parentheses ()

4

all of the above.

4

Multiple Choice

Pilar writes the following code:

print("Hello, my name is Pilar!") What will the computer display?

1
Hello, my name is Pilar
2
Hello, my name is Pilar!
3
Hello, my name is Peter!
4
Hello, my name is Pilar?

5

Multiple Choice

Anything you want printed in Python must be within the ...?

1

parentheses and quotes

2

curly braces only

3

quotes only

4

brackets only

6

7

  1. Str(string) - characters, words, letters, spaces

  2. Int (integers) - positive and negative whole numbers

  3. Float - positive and negative decimal numbers.

Variable Types

8

Match

Match the example to its variable type.

"Hello, World!"

-9

4.99

" @ "

100

string

integer

float

string

integer

9

Variable Naming

  • A variable stores information to be used later.

  • A variable has a

    • NAME,

    • TYPE,

    • SAVED VALUE.

10

Example

last_name = "Reyes"

Variable name is last_name

  • Type = String

  • Assigned value = Reyes

11

Multiple Choice

The following variable, shirt_price = 19.99, has a value of ?

1
15.99
2
25.00
3
19.00
4
19.99

12

Multiple Choice

What is variable name for the following variable, temperature = 99.8 ?

1
temp
2
temperature
3
tempInCelsius
4
temperatureValue

13

Multiple Choice

The variable, location = "Dallas, TX", is what type of variable?

1

float

2
integer
3
string
4
boolean

14

Using and printing a variable

To use a variable, we first must define and declare a variable

Create a variable name and give it an assigned value. Then to print the variable simply put:
print (variable_name)
the print function will print the value attached to the variable name.

15

Dallas, TX

Line 1 : location = "Dallas, TX"
Line 2: print (location)

Example

16

Multiple Choice

Lincoln wants to create a variable called hourly wage with an assigned value of 15.00, which naming is correct?

1
hourly_wage = 15.00
2
hourly_wage = 20.00
3
hourly_wage = 10.00
4
hourly_wage = 15.50

17

Multiple Choice

Sara creates the following variable, hours_worked = 12, and she does the following, print(hours_worked). What will be printed?

1
12
2

hours_worked

3

hours_worked = 12

4

21

18

Poll

What is your understanding of printing, variables, and variable types?

1 = I understand not at all.

2 = I understand somewhat.

3 = I understand mostly, with little confusion.

4 = I understand completely.

media

Printing, Variables, and Variable Types

Show answer

Auto Play

Slide 1 / 18

SLIDE