False (several built-in functions) T/F: The math.pi constant represents pi to 15 decimal places. True T/F: All mathematical functions in Python are part of the math module. True T/F: Full documentation about the Python Standard Library can be found online. False T/F: Built-in functions of the Python Standard Library can be used without being imported. hours // 24 What is the Python Standard Library? A collection of programming components that can be used in any python program T/F: Using components from the Python Standard Library is a rare occurrence. Which of the following expressions will compute how many 24-hour periods are represented by that value, without worrying about any leftover hours. True What is the result of the expression 7 // 2? 3 What is the result of the expression 43 % 5 3 If the variable num contains a positive integer, what are the only two possible results of the expression num % 2? 0 and 1 Suppose the integer variable hours contains a value that represents a number of hours. False (produce a range 0 to n-1) T/F: The math module contains a constant that represents the value pi to several digits. True T/F: If both operands to the remainder operator (%) are positive, a divisor of n will produce a result in the range 1 to n. False (starts with #) What is a docstring? A character string used as a comment in a program T/F: If either or both operands to the division operator (//) are floating-point values, then the result will be a floating-point value. False (helps explain it) T/F: A Python block comment begins with a double slash (//). True T/F: A Python comment cannot appear on a line that contains an executable statement. True T/F: A comment in a Python program is ignored by the interpreter. True T/F: Python comments begin with a hash mark (#) and extend to the end of the line. False The value assigned to a variable could be a floating point number. False In Python, the assignment statement is also an expression. Num = num * 2 8 T/F: The value assigned to a variable must be numeric. False What value is assigned to the variable num by the following statement if the current value of num is 4? False T/F: The assignment operator has higher precedence than the arithmetic operators. False T/F: Python variables that represent integers are NOT object reference variables. True Which of the following is NOT a valid Python identifier? 1stPlace Which of the following identifiers follows the convention for naming Python variables? total_value T/F: In dynamically typed languages, variables are declared to store a specific type of data. True T/F: The value of a variable can change throughout a program. Print('oak', 'elm', 'pine', end='!', sep='#') oak#elm#pine! T/F: Python variables are created using an assignment statement. Print('Jan', 'Feb', 'Mar', sep='-') Jan-Feb-Mar What output is produced by the following code? Print('Go') Ready SetGo What output is produced by the following code? Print(15 + 30) 45 What output does the following code produce? Print('apple', 'banana') apple banana What output is produced by the following code? False What is syntax coloring? Showing certain elements of a program code in different colors What does the term case sensitive mean? The difference between uppercase and lowercase letters matters What output does the following code produce? False Which of the following statements is true? The print statement is a call to a function T/F: A Python program must compiled into an executable form before it can be run. True T/F: A Python program must be enclosed in curly braces to be executed. T/F: The Thonny debugger lets you trace the value of variables while your program is executing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |