Академический Документы
Профессиональный Документы
Культура Документы
A. Interpreted
B. Reliable
C. Simple
D. All of these
ANSWER: D
Which statement ends current iteration of loop and continues with the next one
A. Break
B. Continue
C. Skip
D. Pass
ANSWER: B
Which statement is used to terminate the execution of the nearest enclosing loop in
which it appears
A. Pass
B. Break
C. Continue
D. Jump
ANSWER: B
What would happen if we replace the 'break' statement in the code with a 'continue'
A. It will stop executing
B. It would run forever
C. Error
D. There would be no change
ANSWER: B
If a='cpp', b='buzz' then which of the following operation would show 'cppbuzz' as
output
A. a+b
B. a+''+b
C. a+""+b
D. All of the above
ANSWER: D
The output of which of the codes shown below will be: 'There are 4 blue birds'
A. 'There are %d %s birds' %(4, "blue")
B. 'There are %s %d birds' %[4, "blue"]
C. 'There are %d %s birds' 4, "blue"
D. 'There are %d %s birds' {4, 'blue'}
ANSWER: A
When using find(), if the string to be searched is not present in the string then
what is returned
A. 0
B. -1
C. N-1
D. ValueError
ANSWER: B
Arbitrary arguments have which symbol in the function definition before the
parameter name
A. &
B. #
C. *
D. $
ANSWER: C
In the expression 45/4, the values on the left and right of the / symbol are called
A. Operators
B. Operands
C. Parameters
D. Arguments
ANSWER: B
Which of the following code displays the area of a circle if the radius is positive
A. if radius != 0: print(radius * radius * 3.14159)
B. if radius >= 0: print(radius * radius * 3.14159)
C. if radius > 0: print(radius * radius * 3.14159)
D. if radius <= 0: print(radius * radius * 3.14159)
ANSWER: C
Suppose isPrime is a boolean variable, which of the following is the correct and
best statement for testing if isPrime is true
A. if isPrime = True:
B. if isPrime == True:
C. if isPrime:
D. if not isPrime = False:
ANSWER: C
A function
A. Must have at least one parameter
B. May have no parameters
C. Must always have a return statement to return a value
D. Must always have a return statement to return multiple values
ANSWER: B