INSY 3300 Quiz 1 ch1 & 2
1. Which of the following are steps in the program development cycle? a. Design the program b. Write the code and correct syntax errors c. Test the program d. Correct logic errors
All are correct?
If you want a variable that has not been assigned a value, the number 0 will be displayed.
False
In Python, math expressions are always evaluated from left to right, no matter what the operators are.
False
Python formats all floating-point numbers to two decimal places when outputting with the print statement
False
Variable name can contain space but are case sensitive.
False
IDLE is an alternative method to using a text editor to write, execute, and test a python program.
True
In Python, print statements written on separate lines do not necessarily output on separate lines.
True
The formatting specifier is a special set of characters that specify how a value should be formatted.
True
1. Which mathematical operator is used to raise 5 to the second power in Python? a. / b. ** c. * d. ~
b. **
What is the output of the following command, given that value1=2.0 and value2=12? Print(value1 * value2) a) 24 b) value1*value2 c) 24.0 d) 2.0*12
c) 24.0
In a print statement, you can set the _____ argument to a space or empty string to stop the output from advancing to a new line. a. Stop b. Separator c. End d. Newline
c. End
1. What is the output of the following statement? Print('One' 'Two' 'Three') a. One Two Three b. One Two Three c. OneTwoThree d. Nothing—This statement contains an error.
c. OneTwoThree
1. What symbol is used to mark the beginning and end of a string? a. A slash (/) b. An asterisk (*) c. A quote mark ('') d. A comma (,)
c. a quote mark ('')
The smallest storage location in a computer's memory is known as a. byte b. switch c. gb d. bit
d. bit
1. What would the following display? Print('george','john','paul',sep='@')
george@john@paul