

MCQOPTIONS
Saved Bookmarks
This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which of the following would give "Harry" as output? Given str1="Mary,Harry,John,Sam" |
A. | str1[4:9] |
B. | str1[5:10] |
C. | str1[4:10] |
D. | str1[5:9] |
E. | |
Answer» C. str1[4:10] | |
2. |
Which of the following operations cannot be done on string str1, where str1="LETSFINDCOURSE."? |
A. | str1+="Learning made easy" |
B. | str1[1]="a" |
C. | print(str1[1]) |
D. | str1[0:4] |
Answer» C. print(str1[1]) | |
3. |
Which of the following two will give the same result?(i) 42//2 (ii) 21%6 (iii) 12/4 (iv) 11*2 |
A. | ii,iii |
B. | i, iii |
C. | ii, iv |
D. | iii, iv |
Answer» B. i, iii | |
4. |
b=1 if (a and b): print("hi") elif(not(a)): print("hello") elif(b): print("hi world") else: print("hello world") |
A. | i, iii, ii |
B. | ii, iii ,i |
C. | iii, ii, i |
D. | ii, i, iii |
Answer» B. ii, iii ,i | |
5. |
print(i) |
A. | hello world |
B. | hi |
C. | hi world |
D. | hello |
Answer» E. | |
6. |
var2=5 var3=1 var4=10 var5=20 (var1*var2)>(var5+var4*var3) and ((var5+var3)/var1)>=(var2-2)/var3 |
A. | 0, -1 |
B. | 0, -1, -1 |
C. | -1, -2 |
D. | Error |
Answer» B. 0, -1, -1 | |
7. |
var1=0 var2=var1+1 while(var<7): var2=var2+var1 if(var1%2==0): var=var+1 var1=var1+1 else: var2=var2*var1 var1=var1+3 |
A. | (var5/var4)>var3 and (var3*var2)>=(var1*var3) |
B. | (var5-var4)*var2@@<var3 or></var3> |
C. | (var4/var2)>var1 and (var1*3)/var3 |
D. | (var1/var3)>var4 or var5*2==var4 |
Answer» C. (var4/var2)>var1 and (var1*3)/var3 | |
8. |
b=6 x=(a&b)|(a&a | a&b) y=not(x) print(y) |
A. | 12,648 |
B. | 13,648 |
C. | 13,660 |
D. | 9,72 |
Answer» D. 9,72 | |