Core Python Quiz

Core Python Quiz

Start Quiz
Question 1 / 50

Q In Python, for and while loop can have optional else statement ?

Python allows string slicing. What is the output of below code: s=‘cppbuzz chicago’ print(s[3:5])

What is the output of the code shown below ? t=32.00 [round((x-32)*5/9)for x in t]

What is the output of the following ? print([i.lower()for i in “HELLO”])

Which of the following statement is true ?

if a=‘cpp’, b=‘buzz’ then which of the following operation would show ‘cppbuzz’ as output ?

Which function is used to open the file for reading in Python ?

Who created Python ?

Are string object mutable ?

Which of the following keyword is a valid placeholder for body of the function ?

print(chr(ord(‘b’)+1))

What is the output of “hello” +1+2+3 ?

Q.

The format function, when applied on a string returns :-

What is correct syntax to copy one list into another ?

What is used to define a block of code (body of loop, function etc.) in Python ?

Use of parentheses can change the order of evaluation ?

Q The if…elif…else executes only one block of the code among Several blocks.

Which of the following statement is true ?

Q

Is Python compiled language ?

What is the output of the following code ? print (1,2,3,4, sep=‘*’)

Q.

How following evaluates in Python ? round(0.5)-round(-0.5)

Which of the following is correct?

print type(1J) ?

What is output for – raining‘.find(‘z’)?

Which of the following codes closes file automatically if exception occurs ?

a)
b)
c) None of the above
d) Both of the above

Which of the following is not a valid mode to open a file ?

Q. The format function, when applied on a string returns :

To read the next line of the from a file object infile, we use

Q

Select the reserved keyword in Python ?

Q. Is the better to use for loop instead of while if you are Iterating through a sequence (like:list)?

What is a recursive function ?

let a=[1,2,3,4,5] then which of the following is correct ?

Q.

Can return statement in python used to return multiple values ?

All keyword in Python are in –

answered 0/

Result

0%

Passing grade - 65%