NEW
Font size
WorksheetsX-Quiz #4
Total questions: 10
Worksheet time: 5mins
Name the error that doesn’t cause program to stop/end, but the output is not the desired result or is incorrect
Syntax error
Runtime error
Logical error
All of the above
What is output of following code −
l = [1,2,6,5,7,8]
l.insert(9)
l=[9,1,2,6,5,7,8]
l=[1,2,6,5,9.7,8] (insert randomly at any position)
l=[1,2,6,5,7,8,9]
Type Error
Analyze the code −
Recursive Function 40320.
Recursive Function.
Function runs infinitely and causes a StackOverflowError.
Syntax Error.
Which of the following is more accurate for the following declaration?
x = Circle()
Now you can assign int value to x
x contains a reference to a Circle object.
x actually contains a object of type circle
x contains an int value
What will be the output of the following code?
print(type(1/5))
<class 'float'>
<class 'int'>
NameError: '1/2' not defined
0.5
What is output for following code
y = [4, 5,1j]y.sort()
[1j,4,5]
[5,4,1j]
[4,5,1j]
Type Error
What is the output of the following code
50
NameError
None
0
In Java, Class is a ___ data type
User Defined
Pre-Defined
System Defined
None of the above
What is the output of the python expression :
print '{0:-2%}'.format(1.0 / 3)
33.33%
33%
1/3%
.33%
Predict the output:
#include <stdio.h>
int main()
{
char a = 012;
printf("%d", a);
return 0;
}
10
012
12
010
