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

Medical terminology EXAM 3 pt.1 (CH.5 Cardiovascular system)

View Set

World History 10.2 - The Crusades

View Set

Phrases, clauses, and sentence structure

View Set

Chapter #18: Haircoloring and Lightening

View Set

Shawn's Pharmacology Study Guide

View Set