CS 1101 UNIT 1 QUIZ - SelfQuiz PDF

Title CS 1101 UNIT 1 QUIZ - SelfQuiz
Course Programming Fundamentals
Institution University of the People
Pages 15
File Size 323.3 KB
File Type PDF
Total Downloads 28
Total Views 341

Summary

FIRST TIMEstring is a Python type that represents sequences of numeric values. Select one:True False Question 2 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....


Description

FIRST TIME string is a Python type that represents sequences of numeric values. Select one: True False Question 2 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 ( wrong) d. a statement e. a value Question 3

Question text Match concepts with their definition! An error in a program.

Bug1

The process of finding and removing any of the three kinds of programming errors.

Debugging2

Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs; all programming languages are these kinds of languages.

Formal language 3

A programming language like Python that is designed to be easy for humans to read and write.

High-level language 4

A program that reads another program and executes it.

Interpreter 5

A programming language that is designed to be easy for a computer to execute; also called machine language or assembly language.

Low-level language 6

Any one of the languages that people speak that evolved naturally.

Natural language 7

To examine a program and analyze the syntactic structure.

Parse 8

A property of a program that can run on more than one kind of computer.

Portability 9

An instruction that causes the Python interpreter to display a value on the screen.

Print statement 10

The process of formulating a problem, finding a solution, and expressing the solution.

Problem solving 11

A sequence of instructions that specifies to a computer actions and computations to be performed.

Program 12

A program stored in a file (usually one that will be interpreted).

Script 13

The structure of a program.

Syntax 14

One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.

Token 15

Question 4 ot yet answered Marked out of 1.00 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

b. an operator c. a prompt d. a statement e. a value Question 5 Which one of the following Python expressions has the value 64? Select one: a. 8 ^ 2 b. 8 ** 2 c. 8 +- 2 d. 8 += 2 e. 8 -+ 2 Question 6 Which one of the following Python expressions has the value 10? Select one: a. 8 ^ 2 b. 8 ** 2 c. 8 +- 2 d. 8 += 2 e. 8 -+ 2 Question 7 What is python’s response to the command: type("0.123") Select one: a.

b. c. SyntaxError: invalid syntax d. e. Question 8 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) e. SyntaxError: invalid token Question 9 Consider the following text from a Python interpreter. >>> print(2 + 2) 4 What is the text "4" called? Select one: a. a function b. an operator c. a prompt d. a statement e. a value

Question 10 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 (wrong) b. 5 / 1.61 c. 1.61 / 5 d. 1.61 + 5 e. miles = "5 km" ( wrong)

SENCOND TIME True or False: Learning to debug can be frustrating, but it is a valuable skill that is useful for many activities beyond programming. Select one: True False Question 2 Which one of the following words best describes formal languages? Select one: a. ambiguity b. literalness c. poetry d. prose e. redundancy Question 3 Consider the following text from a Python interpreter.

>>> print(2 + 2)

4 What is the text "+" called?

Select one: a. a function b. an operator c. a prompt d. a statement e. a value Question 4 A program is a sequence of instructions that specifies how to perform a computation. Select one: True False Question 5 Which of the following is not a valid Python numeric literal: Select one: a. 123 b. 0123 c. 0.00 d. 12.3 e. 0.75 Question 6 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 e. 8 -+ 2 Question 7 What is Python’s response to the command: type(0.123) Select one: a. b. c. SyntaxError: invalid syntax d. e. Question 8 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. e. The emoji for "food chain". Question 9 What is Python’s response to the command: type(123) Select one: a.

b. c. SyntaxError: invalid syntax d. e. Question 10 Portability means the program is written in small chunks of code. Select one: True False

THIRD TIME(only 3new) Programming languages are ______ languages that have been designed to express computations. Select one: a. informal b. mathematical c. formal d. natural e. logical

Question 2 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 e. seconds = 21 + "21 minutes"

Question 3 Consider the following text from a Python interpreter. >>> print(2 + 2) 4 What is the text ">>>" called? Select one: a. a function b. an operator c. a prompt d. a statement e. a value

FOURTH TIME string is a Python type that represents sequences of numeric values. Select one: True False Feedback The correct answer is 'False'.

Question 2 Correct Mark 1.00 out of 1.00

Flag question Question text A program is a sequence of instructions that specifies how to perform a computation.

Select one: True False Feedback The correct answer is 'True'.

Question 3 Correct Mark 1.00 out of 1.00

Flag question Question text Which one of the following Python expressions has the value 10? Select one: a. 8 ^ 2 b. 8 ** 2 c. 8 +- 2 d. 8 += 2 e. 8 -+ 2 Feedback Your answer is correct. The correct answer is: 8 ^ 2

Question 4 Correct Mark 1.00 out of 1.00

Flag question Question text Consider the following text from a Python interpreter. >>> print(2 + 2) 4 What is the text ">>>" called? Select one: a. a function b. an operator c. a prompt d. a statement e. a value Feedback Your answer is correct. The correct answer is: a prompt

Question 5 Correct Mark 1.00 out of 1.00

Flag question Question text Programming languages are ______ languages that have been designed to express computations. Select one:

a. informal b. mathematical c. formal d. natural e. logical Feedback Your answer is correct. The correct answer is: formal

Question 6 Correct Mark 1.00 out of 1.00

Flag question Question text 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 e. seconds = 21 + "21 minutes" Feedback Your answer is correct. The correct answer is: 21 * 60 + 21

Question 7

Correct Mark 1.00 out of 1.00

Flag question Question text 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) e. SyntaxError: invalid token Feedback Your answer is correct. The correct answer is: (1, 234.567, 890)

Question 8 Correct Mark 1.00 out of 1.00

Flag question Question text 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 e. a value Feedback Your answer is correct. The correct answer is: a function

Question 9 Correct Mark 1.00 out of 1.00

Flag question Question text Consider the following text from a Python interpreter. >>> print(2 + 2) 4 What is the text "4" called? Select one: a. a function b. an operator c. a prompt d. a statement e. a value Feedback

Your answer is correct. The correct answer is: a value

Question 10 Correct Mark 1.00 out of 1.00

Flag question Question text Which one of the following words best describes formal languages? Select one: a. ambiguity b. literalness c. poetry d. prose e. redundancy Feedback Your answer is correct. The correct answer is: literalness Finish review...


Similar Free PDFs