Module 1 Quiz

Ace your homework & exams now with Quizwiz!

Have a look at the four Python expressions below. Which one of these will throw an error?

"The correct answer to this multiple choice question is answer number" + 2

How do you insert COMMENTS in Python code?

#This is a comment

For which applications can you use Python?

- You want to do some quick calculations. - For your new business, you want to develop a database-driven website. - Your boss asks you to clean and analyze the results of the latest satisfaction survey.

What is the correct file extension for Python files?

.py

What is the output of the following code: var1 = 1 var2 = 2 var3 = "3" print(var1 + var2 + var3)

Error

What are the correct types for the following variables: a, b and c a = 3.0 b = str(a) c = False

a is of type float, b is of type str, c is of type bool

Which one is NOT a legal variable name in Python?

my-var

What is a correct syntax to output "Hello World" in Python?

print("Hello World")

What is the correct syntax to output the type of a variable or object in Python?

print(type(x))

How do you create a variable with the numeric value 5 ?

x = int(5.5) x = 5


Related study sets

PF- 3 Overview of a Budget, Spending, & Money Management Tools- 10/10/17(Tue.)- Q #1- Budget

View Set

A&P II - 11.3 Nervous Tissue - Neurons are classified on the basis of structure and function.

View Set

Therapy 5 Final Exam Big Concepts

View Set

12.2 C.S. Lewis, Right and Wrong as a Clue to the Meaning of the Universe.

View Set

Human Nutrition Chapter 3 - Food Groups, Nutrition Info

View Set