Unit 1 QUIZ 1 PDF

Title Unit 1 QUIZ 1
Author Fiifi Mensah
Course Programming Fundamentals
Institution University of the People
Pages 3
File Size 84.4 KB
File Type PDF
Total Downloads 4
Total Views 132

Summary

Self Quiz for Programming Fundamentals...


Description

Quiz 1 Unit 1

1. Consider the following text from a Python interpreter. >>> print(2 + 2) 4 What is the text "print(2 + 2)" called? Select one: a. a function (Answer) b. an operator c. a prompt d. a statement e. a value 2. What is Python’s response to the command: type(123)

Select one: a. b. c. SyntaxError: invalid syntax d. (Answer) e.

3. What does the following text indicate in a Python interpreter? >>>

Select one: a. A syntax error has occurred. b. One value is much greater than another. c. Shift a value to the right. d. The interpreter is ready for you to enter code. (Answer) e. The emoji for "food chain".

4. Which one of the following Python expressions generates a syntax error?

Select one: a. 8 ^ 2

b. 8 ** 2 c. 8 +- 2 d. 8 += 2 (Answer) e. 8 -+ 2

5. What is Python’s response to the command: type (0.123)

Select one: a. (Answer) b. c. SyntaxError: invalid syntax d. e. 6. Which one of the following Python expressions computes the number of miles in 5 km, where one mile is 1.61 km?

Select one: a. 5 * 1.61 b. 5 / 1.61 (Answer) c. 1.61 / 5 d. 1.61 + 5 e. miles = "5 km" 7. What does the Python interpreter output for the following input?

>>> 1,234.567,890 Select one: a. 1234 b. 1234.6 c. 1234.56789 d. (1, 234.567, 890) (Answer) e. SyntaxError: invalid token 8. Which one of the following Python expressions computes the total number of seconds in 21 minutes and 21 seconds?

Select one: a. 21 + 21 b. 21 + 60 c. "21 minutes" + "21 seconds" d. 21 * 60 + 21 (Answer) e. seconds = 21 + "21 minutes"

9. string is a Python type that represents sequences of numeric values. Select one: True False (Answer)

10. Consider the following text from a Python interpreter.

>>> print(2 + 2) 4

What is the text "print" called? Select one: a. a function b. an operator c. a prompt d. a statement (Answer) e. a value Clear my choice...


Similar Free PDFs