Pro-1 Quiz 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What does the following Python program print? x = 12 % 4 print(x) 0 1 3 4

0

What does the following Python program print? x = 9 + 6 / 3 * 2 - 1 print(x) 9 12 15 21

12

x = input("Enter some text: ") print(x) Python While the program is running, after the prompt has been printed, the user types the following and presses Enter:Delaware ratified the U.S. Constitution in 1787.What does the program print? Delaware ratified the U.S. Constitution in 1787. Delaware ratified the U.S. Constitution in Delaware (The program does not print anything.)

Delaware ratified the U.S. Constitution in 1787.

Question: 2 What does the following Python code display? print("Hello") print("World") Hello World HelloWorld Hello World Hello World

Hello World

What does the following Python program print? x = "I am" y = 6 z = "feet tall" print(x) print(y) print(z) I am 6 feet tall I am6feet tall I am6feet tall xyz

I am 6feet tall

Which Python code segment will display "Hello, world!" on the screen? display Hello, world! print("Hello, world!") print "Hello, world!" "Hello, world!"

print("Hello, world!")

What is the type of the variable x in the following Python program? x = input("Enter something: ") string integer float The type cannot be determined.

string

What type is the following variable? x = "Hi there" float integer boolean string

string

Which of the following is NOT a program that will produce the following output? hellohellohello var = "hello" * 3 print(var) var = "hello" + "hello" + "hello" print(var) var = "hello" print(var) print(var) print(var) In the following code, assume the user enters 3. num_times = int(input("How many times?: ")) var = "hello" * num_times print(var)

var = "hello" print(var) print(var) print(var)

Which of the following Python programs will not run? x = 4 y = 5 print(x + y) x = 4 y = "hi" print(x + y) x = 4 y = 5.5 print(x + y) x = 4 print(x + 5)

x = 4 y = "hi" print(x + y)


Kaugnay na mga set ng pag-aaral

CH. 9-11 Book Questions FIN-4970

View Set

chapter two: values and attitudes

View Set

Chapter 12: Math Fundamentals on the GRE

View Set

Psych 314 Exam 3 Multiple Choice

View Set

IMC Exam 3 Chapter 10 Sample Questions

View Set

fitness assessment and design quiz 4

View Set