Python - Test Yourself2

What output will the following python command produce:
>>> print (1,000,000)

Select one:
 a. 1,000
 b. 1,000,000
 c. 1 0 0 
 d. Error invalid type


What output will the following python commands produce:
>>> n = 17
>>> print (n)

Select one:
 a. (n)
 b. 17.0
 c. n
 d. 17  




What output will the following python command produce:
>>> percentage = ( 60 * 100) // 55
>>> print (percentage)

Select one:
 a. percentage
 b. 109 
 c. 109.0909090909091
 d. 109.0






What output will the following python commands produce:
>>> print (2 * (3-1))

Select one:
 a. 6
 b. 5
 c. 4 
 d. 3




What output will the following python commands produce:
 >>> print ((1+1)**(5-2))

Select one:
 a. 16
 b. 8
 c. 4
 d. 2



What output will the following python commands produce:
>>> print (2*3-1)

Select one:
 a. 6
 b. 5 
 c. 4
 d. 3


Programmers generally choose names for their variables that
are meaningful and document what the variable is used for.

Select one:
 True 
 False




Variable names are not case sensitive.

Select one:
 True
 False  





Using
keywords for variable names will result in a ________________

Select one:
 a. runtime error
 b. compile error
 c. syntax error 
 d. semantic error






A script
usually contains a sequence of statements. If there is more than one statement,
the results appear one at a time as the statements execute.

Select one:
 True 
 False





An
expression is a combination of values, variables, and operators. If you type an
expression on the command line, the interpreter evaluates it and displays the
result.

Select one:
 True 
 False






In a script,
an expression all by itself is a legal statement, but it doesn't do anything.

Select one:
 True 
 False





The acronym
PEMDAS is a useful way to remember the order of operations in Python.

Select one:
 True 
 False






As programs
get bigger and more complicated, they get more difficult to read. This is why
programmers should use Comments in their code.

Select one:
 True 
 False






What output
will the following python command produce:
percentage =
( 60.0 * 100.0 ) / 55.0
print
(percentage)

Select one:
 a. percentage
 b. 109
 c. 109.0909090909091 
 d. 109.0







No comments:

Post a Comment