Module 1 Quiz

Pataasin ang iyong marka sa homework at exams ngayon gamit ang 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


Kaugnay na mga set ng pag-aaral

Personality Psychology Exam 3 (Chapters 12, 13, & 14)

View Set

CHAPTER 15: PSYCHOLOGICAL DISORDERS

View Set

SPN 202 12.3 SUMMARY OF THE SUBJUNCTIVE

View Set

Chapter 13: Spinal Cord and Spinal Nerves Review

View Set