Python Class 1 variables, print, operations

Python Class 1 variables, print, operations

1st - 5th Grade

6 Qs

quiz-placeholder

Similar activities

Worksheet Test Primary 5 - PowerPoint

Worksheet Test Primary 5 - PowerPoint

5th Grade

10 Qs

Grade 4

Grade 4

4th Grade

10 Qs

Lớp 4-Soạn thảo, chỉnh sửa văn bản

Lớp 4-Soạn thảo, chỉnh sửa văn bản

4th Grade

10 Qs

EVALUASI EMAIL

EVALUASI EMAIL

1st Grade

10 Qs

Computer Security

Computer Security

5th Grade

10 Qs

BÀI 10: PHẦN SOẠN THẢO VĂN BẢN

BÀI 10: PHẦN SOẠN THẢO VĂN BẢN

4th Grade

10 Qs

Computer Basics

Computer Basics

KG - 3rd Grade

10 Qs

Grade 1 Scratch jr

Grade 1 Scratch jr

1st Grade

10 Qs

Python Class 1 variables, print, operations

Python Class 1 variables, print, operations

Assessment

Quiz

Computers

1st - 5th Grade

Hard

Created by

doosuf ]

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of these is the variable?

print

'Fred'

name

=

Answer explanation

name is the variable, 'Fred' is the string stored in the variable, print is the function, = is the assignment operator

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following code would print out:

nothing, it will return an error

7

8

Answer explanation

you can do operations in function input

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

After this code executes, what is the value of name

'Elisa'

'John'

'Fred'

'Jane'

Answer explanation

it's 'Elisa' because that was the last update made to the variable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which error would occur when this program is run? 

no error

NameError: name 'Name' is not defined

TypeError: Can't convert 'int' object to str implicitly

NameError: name 'Bob' is not defined

Answer explanation

variables are case sensitive, a variable called Name is NOT EQUAL to a variable called name

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How to do floor division?

n1 ** n2

n1/n2

n1//n2

n1 * n2

Answer explanation

// is floor division

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

How would I print out my age? (concatenation, tuples, output formatting)

print("Age: " + age)

print("Age:",age)

print("Age: %s" % (age))

print("Age: age")