MCQGeeks
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
Python
Basic Python
Quiz 1
Solution
Q.1.
What will be the output of the following Python code? print("abc DEF".capitalize())
a) abc def
b) ABC DEF
c) Abc def
d) Abc Def
Q.2.
What will be the output of the following Python code? print("abc. DEF".capitalize())
a) abc. def
b) ABC. DEF
c) Abc. def
d) Abc. Def
Q.3.
What will be the output of the following Python code? print("abcdef".center())
a) cd
b) abcdef
c) error
d) none of the mentioned
Q.4.
What will be the output of the following Python code? print("abcdef".center(0))
a) cd
b) abcdef
c) error
d) none of the mentioned
Q.5.
What will be the output of the following Python code? print('*', "abcdef".center(7), '*')
a) * abcdef *
b) * abcdef *
c) *abcdef *
d) * abcdef*
Q.6.
What will be the output of the following Python code? print('*', "abcdef".center(7), '*', sep='')
a) * abcdef *
b) * abcdef *
c) *abcdef *
d) * abcdef*
Q.7.
What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='')
a) * abcde *
b) * abcde *
c) *abcde *
d) * abcde*
Q.8.
What will be the output of the following Python code? print("abcdef".center(1))
a) 1abcdef
b) abcdef1
c) abcdef
d) error
Q.9.
What will be the output of the following Python code? print("abcdef".center('1'))
a) 1abcdef
b) abcdef1
c) abcdef
d) error
Q.10.
What will be the output of the following Python code? print("abcdef".center('12'))
a) 12abcdef12
b) abcdef1212
c) 1212abcdef
d) error
Support mcqgeeks.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page