CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

9th Grade - Professional Development

20 Qs

quiz-placeholder

Similar activities

Python

Python

6th - 10th Grade

17 Qs

Basic Python Concepts and Console Interaction

Basic Python Concepts and Console Interaction

11th - 12th Grade

20 Qs

Python Interaction

Python Interaction

9th Grade - Professional Development

20 Qs

วิทยาการคำนวณ ม.2

วิทยาการคำนวณ ม.2

11th Grade

20 Qs

Computer Science (Python)

Computer Science (Python)

9th Grade

18 Qs

Введение в Python. Ветвление

Введение в Python. Ветвление

8th - 9th Grade

16 Qs

Python Basics Recap

Python Basics Recap

8th - 11th Grade

23 Qs

Pandas Series-1

Pandas Series-1

12th Grade

21 Qs

CodeHS - Intro to Python - Basics and Console Interaction

CodeHS - Intro to Python - Basics and Console Interaction

Assessment

Quiz

Computers

9th Grade - Professional Development

Medium

Created by

Thomas Archer

Used 68+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a binary operator and a unary operator?

A computer can use binary operators, but it cannot use unary operators.

A unary operator needs two things, while a binary operator only needs one.

A binary operator needs two things, while a unary operator only needs one.

Binary operators are used for arithmetic expressions, while unary operators are for strings.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

On which line of code will Python error?


weight = input("How much do you weigh? ")

oz_water = weight / 2

print "You should drink " + str(oz_water)

print "ounces of water every day if you weigh " + weight

Line 1

Line 2

Line 3

Line 4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In what order should these statements be executed in order to get input from the user and print out the result?


A) response = input("Do you like cheese? ")

B) print "You have chosen " + confirm

C) print "You responded " + response

D) confirm = input("Are you sure? ")

A, B, C, D

B, C, A, D

A, C, D, B

C, B, A, D

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program? Assume the user enters “Florence”, then “Fernandez”.


first_name = input("What is your first name? ")

last_name = input("What is your last name? ")

whole_name = first_name + last_name

print whole_name

Fernandez Florence

Florence

Fernandez

FlorenceFernandez

Florence Fernandez

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about print statements?


I. In order to print a string literal, the string must be enclosed in quotes.

II. Each print statement will be printed on its own line.

III. Print statements will not let you print strings and numbers in the same statement.

IV. Print statements are how you display text on the screen.

I, IV

II, III

I, II, IV

I, III, IV

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following choices is a properly formed Python variable name, meaning it is both legal in the Python language and considered good style?

user_age

uSeRaGe

user!age!

1user_age

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following choices is NOT a Python variable type?

int

str

float

number

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?