SlideShare a Scribd company logo
1 of 13
What is the output of print(2 ** 3 ** 2)
64
512
2. What is the output of print(2%6)
ValueError
0.33
2
3. Bitwise shift operators (<<, >>) has higher precedence than Bitwise And(&)
operator
False
True
4. What is the output of the following addition (+) operator
a = [10, 20]
b = a
b += [30, 40]
print(a)
print(b)
[10, 20, 30, 40]
[10, 20, 30, 40]
[10, 20]
[10, 20, 30, 40]
5. What is the output of print(2 * 3 ** 3 * 4)
216
864
6. What is the output of print(10 - 4 * 2)
2
12
7. 4 is 100 in binary and 11 is 1011. What is the output of the following bitwise
operators?
a = 4
b = 11
print(a | b)
print(a >> 2)
15
1
14
1
8. What is the output of the expression print(-18 // 4)
-4
4
-5
5
9. What is the output of the following code
print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))
True True False True
False True True True
True True False True
False True False True
10. What is the value of the following Python Expression
print(36 / 4)
9.0
9
11. Whichof the following operators has the highest precedence?
not
&
*
+
12. What is the output of the following code
x = 6
y = 2
print(x ** y)
print(x // y)
66
0
36
0
66
3
36
3
13. What is the output of the following assignment operator
y = 10
x = y += 2
print(x)
12
10
SynatxError
14. What is the output of the following Python code
x = 10
y = 50
if (x ** 2 > 100 and y < 100):
print(x, y)
100 500
10 50
None
15. What is the output of the following code
x = 100
y = 50
print(x and y)
True
100
False
50
Whichmethod should I use to convert String "welcome to the beautiful world
of python" to "Welcome To The Beautiful World Of Python"
capitalize()
title()
2. Select the correct output of the following String operations
strOne = str("pynative")
strTwo = "pynative"
print(strOne == strTwo)
print(strOne is strTwo)
false false
true true
true false
false true
3. Select the correct output of the following String operations
str1 = 'Welcome'
print (str1[:6] + ' PYnative')
Welcome PYnative
WelcomPYnative
Welcom PYnative
WelcomePYnative
4. Select the correct output of the following String operations
str = "my name is James bond";
print (str.capitalize())
My Name Is James Bond
TypeError: unsupported operand type(s) for * or pow(): ‘str’ and ‘int’
My name is james bond
5. Select the correct output of the following String operations
str1 = "my isname isisis jameis isis bond";
sub = "is";
print(str1.count(sub, 4))
5
6
7
6. Choose the correct function to get the ASCII code of a character
char(‘char’)
ord(‘char’)
ascii(‘char’)
7. Select the correct output of the following String operations
myString = "pynative"
stringList = ["abc", "pynative", "xyz"]
print(stringList[1] == myString)
print(stringList[1] is myString)
true false
true true
8. Guess the correct output of the following code?
str1 = "PYnative"
print(str1[1:4], str1[:5], str1[4:], str1[0:-1], str1[:-1])
PYn PYnat ive PYnativ vitanYP
Yna PYnat tive PYnativ vitanYP
Yna PYnat tive PYnativ PYnativ
9. Guess the correct output of the following String operations
str1 = 'Welcome'
print(str1*2)
WelcomeWelcome
TypeError: unsupported operand type(s) for * or pow(): ‘str’ and ‘int’
10. What is the output of the following string operations
str = "My salary is 7000";
print(str.isalnum())
True
False
11. Python does not support a character type; a single character is treated as
strings of length one.
False
True
12. What is the output of the following code
str1 = "My salary is 7000";
str2 = "7000"
print(str1.isdigit())
print(str2.isdigit())
False
True
False
False
True
False
13. Strings are immutable in Python, which means a string cannot be modified.
True
False
14. What is the output of the following string comparison
print("John" > "Jhon")
print("Emma" < "Emm")
True
False
False
False
15. Choose the correctfunction to get the character from ASCII number
ascii(‘number)
char(number)
chr(number)
Select which is true for for loop
Python’s for loop used to iterates over the items of list, tuple, dictionary, set,
or string
else clause of for loop is executed when the loop terminates naturally
else clause of for loop is executed when the loop terminates abruptly
Weuse for loop when we want to perform a task indefinitely until a particular
condition is met
2. What is the output of the following nested loop
for num in range(10, 14):
for i in range(2, num):
if num%i == 1:
print(num)
break
10
11
12
13
11
13
3. What is the value of x
x = 0
while (x < 100):
x+=2
print(x)
101
99
None of the above, this is an infinite loop
100
4. What is the output of the following range() function
for num in range(2,-5,-1):
print(num, end=", ")
2, 1, 0
2, 1, 0, -1, -2, -3, -4, -5
2, 1, 0, -1, -2, -3, -4
5. What is the output of the following for loop and range() function
for num in range(-2,-5,-1):
print(num, end=", ")
-2, -1, -3, -4
-2, -1, 0, 1, 2, 3,
-2, -1, 0
-2, -3, -4,
6. What is the output of the following loop
for l in 'Jhon':
if l == 'o':
pass
print(l, end=", ")
J, h, n,
J, h, o, n,
7. Given the nested if-else structure below, what will be the value of x after
code execution completes
x = 0
a = 0
b = -5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
2
0
3
4
8. What is the value of x after the following nested for loop completes its
execution
x = 0
for i in range(10):
for j in range(-1, -10, -1):
x += 1
print(x)
99
90
100
9. What is the output of the following if statement
a, b = 12, 5
if a + b:
print('True')
else:
print('False')
False
True
10. What is the value of the var after the for loop completes its execution
var = 10
for i in range(10):
for j in range(2, 10, 1):
if var % 2 == 0:
continue
var += 1
var+=1
else:
var+=1
print(var)
20
21
10
30
11. if -3 will evaluate to true
True
False
12. Given the nested if-else below, what will be the value x when the code
executed successfully
x = 0
a = 5
b = 5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
0
4
2
3
13. What is the output of the following nested loop
numbers = [10, 20]
items = ["Chair", "Table"]
for x in numbers:
for y in items:
print(x, y)
10 Chair
10 Table
20 Chair
20 Table
10 Chair
10 Table
In Python3, Whatever you enter as input, the input() function converts it into a
string
False
True
2. Whichof the following is incorrect file handling mode in Python
r
x
t+
b
3. Whichof the following is incorrect file handling mode in Python
wb+
ab
xr
ab+
4. What is the output of print('[%c]' % 65)
65
A
[A]
Syntax Error
5. Use the following file to predict the output of the code
test.txt Content:
aaa
bbb
ccc
ddd
eee
fff
ggg
Code:
f = open("test.txt", "r")
print(f.readline(3))
f.close()
bbb
Syntax Error
aaa
aa
6. In Python3, which functions are used to accept input from the user
input()
raw_input()
rawinput()
string()
7. What is the output of the following print() function
print(sep='--', 'Ben', 25, 'California')
Syntax Error
Ben–25–California
Ben 25 California
8. What will be displayed as an output on the screen
x = float('NaN')
print('%f, %e, %F, %E' % (x, x, x, x))
nan, nan, NAN, NAN
nan, NaN, nan, NaN
NaN, NaN, NaN, NaN,
9. What is true for file mode x
create a file if the specified file does not exist
Create a file, returns an error if the file exists
Create a file if it doesn’t exists else Truncate the existed file
10. What is the output of print('%x, %X' % (15, 15))
15 15
F F
f f
f F
11. What is the output of the following print() function
print('%d %d %.2f' % (11, '22', 11.22))
11 22 11.22
TypeError
11 ’22’ 11.22
12. What is the output of the following code
print('PYnative ', end='//')
print(' is for ', end='//')
print(' Python Lovers', end='//')
PYnative /
is for /
Python Lovers /
PYnative //
is for //
Python Lovers //
PYnative // is for // Python Lovers//
PYnative / is for / Python Lovers/

More Related Content

What's hot

Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...ssuserd6b1fd
 
C++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsC++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsMohammad Shaker
 
The java language cheat sheet
The java language cheat sheetThe java language cheat sheet
The java language cheat sheetanand_study
 
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...ssuserd6b1fd
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st StudyChris Ohk
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th StudyChris Ohk
 
Python programing
Python programingPython programing
Python programinghamzagame
 
Python Conditionals and Functions
Python Conditionals and FunctionsPython Conditionals and Functions
Python Conditionals and FunctionsPooja B S
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)gekiaruj
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th StudyChris Ohk
 

What's hot (20)

C++ L06-Pointers
C++ L06-PointersC++ L06-Pointers
C++ L06-Pointers
 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
 
Java cheatsheet
Java cheatsheetJava cheatsheet
Java cheatsheet
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat Sheet
 
C++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+OperatorsC++ L02-Conversion+enum+Operators
C++ L02-Conversion+enum+Operators
 
C++ L01-Variables
C++ L01-VariablesC++ L01-Variables
C++ L01-Variables
 
The java language cheat sheet
The java language cheat sheetThe java language cheat sheet
The java language cheat sheet
 
Python
PythonPython
Python
 
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
C++ Programming - 11th Study
C++ Programming - 11th StudyC++ Programming - 11th Study
C++ Programming - 11th Study
 
Python programing
Python programingPython programing
Python programing
 
Python Conditionals and Functions
Python Conditionals and FunctionsPython Conditionals and Functions
Python Conditionals and Functions
 
Talk Code
Talk CodeTalk Code
Talk Code
 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
06.Loops
06.Loops06.Loops
06.Loops
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
C++ Programming - 4th Study
C++ Programming - 4th StudyC++ Programming - 4th Study
C++ Programming - 4th Study
 

Similar to Mcq cpup

Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2Abdul Haseeb
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3Abdul Haseeb
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docxRadhe Syam
 
Python Peculiarities
Python PeculiaritiesPython Peculiarities
Python Peculiaritiesnoamt
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdfsrxerox
 
Python basic
Python basic Python basic
Python basic sewoo lee
 
Data Handling.pdf
Data Handling.pdfData Handling.pdf
Data Handling.pdfMILANOP1
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202Mahmoud Samir Fayed
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
Swift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfSwift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfJkPoppy
 
The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189Mahmoud Samir Fayed
 

Similar to Mcq cpup (20)

Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
week4_python.docx
week4_python.docxweek4_python.docx
week4_python.docx
 
Data Handling
Data Handling Data Handling
Data Handling
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
Python From Scratch (1).pdf
Python From Scratch  (1).pdfPython From Scratch  (1).pdf
Python From Scratch (1).pdf
 
Python Peculiarities
Python PeculiaritiesPython Peculiarities
Python Peculiarities
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
 
Python basic
Python basic Python basic
Python basic
 
Data Handling.pdf
Data Handling.pdfData Handling.pdf
Data Handling.pdf
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Swift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfSwift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdf
 
07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt
 
The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189The Ring programming language version 1.6 book - Part 183 of 189
The Ring programming language version 1.6 book - Part 183 of 189
 
Lecture 2 java.pdf
Lecture 2 java.pdfLecture 2 java.pdf
Lecture 2 java.pdf
 

Recently uploaded

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 

Recently uploaded (20)

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 

Mcq cpup

  • 1. What is the output of print(2 ** 3 ** 2) 64 512 2. What is the output of print(2%6) ValueError 0.33 2 3. Bitwise shift operators (<<, >>) has higher precedence than Bitwise And(&) operator False True 4. What is the output of the following addition (+) operator a = [10, 20] b = a b += [30, 40] print(a) print(b) [10, 20, 30, 40] [10, 20, 30, 40] [10, 20] [10, 20, 30, 40] 5. What is the output of print(2 * 3 ** 3 * 4) 216 864 6. What is the output of print(10 - 4 * 2) 2 12 7. 4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators? a = 4
  • 2. b = 11 print(a | b) print(a >> 2) 15 1 14 1 8. What is the output of the expression print(-18 // 4) -4 4 -5 5 9. What is the output of the following code print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j)) True True False True False True True True True True False True False True False True 10. What is the value of the following Python Expression print(36 / 4) 9.0 9 11. Whichof the following operators has the highest precedence? not & * + 12. What is the output of the following code x = 6 y = 2
  • 3. print(x ** y) print(x // y) 66 0 36 0 66 3 36 3 13. What is the output of the following assignment operator y = 10 x = y += 2 print(x) 12 10 SynatxError 14. What is the output of the following Python code x = 10 y = 50 if (x ** 2 > 100 and y < 100): print(x, y) 100 500 10 50 None 15. What is the output of the following code x = 100 y = 50 print(x and y) True 100 False 50
  • 4. Whichmethod should I use to convert String "welcome to the beautiful world of python" to "Welcome To The Beautiful World Of Python" capitalize() title() 2. Select the correct output of the following String operations strOne = str("pynative") strTwo = "pynative" print(strOne == strTwo) print(strOne is strTwo) false false true true true false false true 3. Select the correct output of the following String operations str1 = 'Welcome' print (str1[:6] + ' PYnative') Welcome PYnative WelcomPYnative Welcom PYnative WelcomePYnative 4. Select the correct output of the following String operations str = "my name is James bond"; print (str.capitalize()) My Name Is James Bond TypeError: unsupported operand type(s) for * or pow(): ‘str’ and ‘int’ My name is james bond 5. Select the correct output of the following String operations str1 = "my isname isisis jameis isis bond"; sub = "is"; print(str1.count(sub, 4)) 5
  • 5. 6 7 6. Choose the correct function to get the ASCII code of a character char(‘char’) ord(‘char’) ascii(‘char’) 7. Select the correct output of the following String operations myString = "pynative" stringList = ["abc", "pynative", "xyz"] print(stringList[1] == myString) print(stringList[1] is myString) true false true true 8. Guess the correct output of the following code? str1 = "PYnative" print(str1[1:4], str1[:5], str1[4:], str1[0:-1], str1[:-1]) PYn PYnat ive PYnativ vitanYP Yna PYnat tive PYnativ vitanYP Yna PYnat tive PYnativ PYnativ 9. Guess the correct output of the following String operations str1 = 'Welcome' print(str1*2) WelcomeWelcome TypeError: unsupported operand type(s) for * or pow(): ‘str’ and ‘int’ 10. What is the output of the following string operations str = "My salary is 7000"; print(str.isalnum()) True False
  • 6. 11. Python does not support a character type; a single character is treated as strings of length one. False True 12. What is the output of the following code str1 = "My salary is 7000"; str2 = "7000" print(str1.isdigit()) print(str2.isdigit()) False True False False True False 13. Strings are immutable in Python, which means a string cannot be modified. True False 14. What is the output of the following string comparison print("John" > "Jhon") print("Emma" < "Emm") True False False False 15. Choose the correctfunction to get the character from ASCII number ascii(‘number) char(number) chr(number) Select which is true for for loop
  • 7. Python’s for loop used to iterates over the items of list, tuple, dictionary, set, or string else clause of for loop is executed when the loop terminates naturally else clause of for loop is executed when the loop terminates abruptly Weuse for loop when we want to perform a task indefinitely until a particular condition is met 2. What is the output of the following nested loop for num in range(10, 14): for i in range(2, num): if num%i == 1: print(num) break 10 11 12 13 11 13 3. What is the value of x x = 0 while (x < 100): x+=2 print(x) 101 99 None of the above, this is an infinite loop 100 4. What is the output of the following range() function for num in range(2,-5,-1): print(num, end=", ") 2, 1, 0 2, 1, 0, -1, -2, -3, -4, -5 2, 1, 0, -1, -2, -3, -4 5. What is the output of the following for loop and range() function
  • 8. for num in range(-2,-5,-1): print(num, end=", ") -2, -1, -3, -4 -2, -1, 0, 1, 2, 3, -2, -1, 0 -2, -3, -4, 6. What is the output of the following loop for l in 'Jhon': if l == 'o': pass print(l, end=", ") J, h, n, J, h, o, n, 7. Given the nested if-else structure below, what will be the value of x after code execution completes x = 0 a = 0 b = -5 if a > 0: if b < 0: x = x + 5 elif a > 5: x = x + 4 else: x = x + 3 else: x = x + 2 print(x) 2 0 3 4 8. What is the value of x after the following nested for loop completes its execution x = 0 for i in range(10): for j in range(-1, -10, -1): x += 1
  • 9. print(x) 99 90 100 9. What is the output of the following if statement a, b = 12, 5 if a + b: print('True') else: print('False') False True 10. What is the value of the var after the for loop completes its execution var = 10 for i in range(10): for j in range(2, 10, 1): if var % 2 == 0: continue var += 1 var+=1 else: var+=1 print(var) 20 21 10 30 11. if -3 will evaluate to true True False 12. Given the nested if-else below, what will be the value x when the code executed successfully x = 0 a = 5 b = 5
  • 10. if a > 0: if b < 0: x = x + 5 elif a > 5: x = x + 4 else: x = x + 3 else: x = x + 2 print(x) 0 4 2 3 13. What is the output of the following nested loop numbers = [10, 20] items = ["Chair", "Table"] for x in numbers: for y in items: print(x, y) 10 Chair 10 Table 20 Chair 20 Table 10 Chair 10 Table In Python3, Whatever you enter as input, the input() function converts it into a string False True 2. Whichof the following is incorrect file handling mode in Python r x t+ b 3. Whichof the following is incorrect file handling mode in Python
  • 11. wb+ ab xr ab+ 4. What is the output of print('[%c]' % 65) 65 A [A] Syntax Error 5. Use the following file to predict the output of the code test.txt Content: aaa bbb ccc ddd eee fff ggg Code: f = open("test.txt", "r") print(f.readline(3)) f.close() bbb Syntax Error aaa aa 6. In Python3, which functions are used to accept input from the user input() raw_input() rawinput() string() 7. What is the output of the following print() function
  • 12. print(sep='--', 'Ben', 25, 'California') Syntax Error Ben–25–California Ben 25 California 8. What will be displayed as an output on the screen x = float('NaN') print('%f, %e, %F, %E' % (x, x, x, x)) nan, nan, NAN, NAN nan, NaN, nan, NaN NaN, NaN, NaN, NaN, 9. What is true for file mode x create a file if the specified file does not exist Create a file, returns an error if the file exists Create a file if it doesn’t exists else Truncate the existed file 10. What is the output of print('%x, %X' % (15, 15)) 15 15 F F f f f F 11. What is the output of the following print() function print('%d %d %.2f' % (11, '22', 11.22)) 11 22 11.22 TypeError 11 ’22’ 11.22 12. What is the output of the following code print('PYnative ', end='//') print(' is for ', end='//') print(' Python Lovers', end='//')
  • 13. PYnative / is for / Python Lovers / PYnative // is for // Python Lovers // PYnative // is for // Python Lovers// PYnative / is for / Python Lovers/