Python Unit 02 - Libraries and Variables

Python Unit 02 - Libraries and Variables

6th - 9th Grade

31 Qs

quiz-placeholder

Similar activities

Unit 2 - Web Development Lesson #2-3

Unit 2 - Web Development Lesson #2-3

6th Grade

28 Qs

Module 24 - Portable Computing 2

Module 24 - Portable Computing 2

9th - 12th Grade

28 Qs

Macromedia Flash

Macromedia Flash

8th Grade - Professional Development

26 Qs

Hardware and Software

Hardware and Software

4th - 6th Grade

26 Qs

Soal Latihan Sumatif Tengah Semester Informatika

Soal Latihan Sumatif Tengah Semester Informatika

7th Grade

35 Qs

General Knowledge

General Knowledge

5th Grade - University

26 Qs

Binary Quiz

Binary Quiz

5th - 12th Grade

26 Qs

CSS g9 2Q 1st Summative

CSS g9 2Q 1st Summative

9th Grade

28 Qs

Python Unit 02 - Libraries and Variables

Python Unit 02 - Libraries and Variables

Assessment

Quiz

Computers

6th - 9th Grade

Practice Problem

Medium

Created by

Tom Riherd

Used 11+ times

FREE Resource

AI

Enhance your content in a minute

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

31 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You've been asked to write a program that asks a user for a value. The value must be used as a whole number in a calculation even if the user enters a decimal value. To help complete the code for this requirement, which code segment should you use?

total_items = float(input("How many items would you like?"))

total_items = input("How many items would you like?")

total_items = str(input("How many items would you like?"))

total_items = int(input("How many items would you like?"))

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Match the data type to the code segment containing it.


Which of the segment below would represent a type bool

age = 2

tiger = False

name = "Albert"

grade = 91.7

zip = "32054"

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Match the data type to the code segment containing it.


Which of the segment below would represent a type int

age = 2

tiger = False

name = "Albert"

grade = 91.7

zip = "32054"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Match the data type to the code segment containing it.


Which of the segment below would represent a type str

age = 2

tiger = False

name = "Albert"

grade = 91.7

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Match the data type to the code segment containing it.


Which of the segment below would represent a type float

age = 2

tiger = False

name = "Albert"

grade = 91.7

zip = "32054"

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

After running code segment 1 shown below, what will the data type of variable a be?


# Code segment 1

x1 = "20"

y1 = 3

a = x1 * y1

str

int

float

bool

none of these, code will produce an error instead.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

After running code segment 2 shown below, what will the data type of variable b be?


# Code segment 2

x2 = 6

y2 = 4

b = x2 / y2

str

int

float

bool

none of these, code will produce an error instead.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?