Python MCQ
Python Division: Predict the output of the following code. d = 23//5
Code
d = 23//5
print(d)
Python: Predict Output Can you predict what will be the value of 'a' after executing the following code?
Code
a = 21 % 4
Python: Predict Output for p = 4**3
Code
p = 4**3
print(p)
What will be the output of the above code snippet?
The netflix dictionary contains a list of 100 titles along with their total number of views in the past.
Based on the keys and values provided in this dictionary, answer the questions given below.
In a school, there are total 100 students numbered from 1 to 100.
You’re given three lists named ‘C’, ‘F’, and ‘H’, representing students who play cricket, football, and hockey, respectively. Based on this information, find out and print the following:
Range Function: What will the output of the following line of code be?
Code
print(list(range(10, 1, -1)))
Python Comprehensions: What will the ‘comprehension equivalent’ be for the following snippet of code?
Code
for sentence in paragraph:
for word in sentence.split():
single_word_list.append(word)
Pagination
- Page 1
- Next page