Which of the following is not used as loop in Python?
What will be the output of given Python code?
Which of the following Python code will give different output from the others?
What keyword would you use to add an alternative condition to an if statement?
Can we write if/else into one line in python?
What will be output of this expression:
'p' + 'q' if '12'.isdigit() else 'r' + 's'
What will be the output of the following code?
list1 = [3 , 2 , 5 , 6 , 0 , 7, 9]
sum = 0
sum1 = 0
for elem in list1:
if (elem % 2 == 0):
sum = sum + elem
if (elem % 3 == 0):
sum1 = sum1 + elem
print(sum , end=" ")
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:
var += 1
What is the output of the following nested loop ?
numbers = [10, 20]
items = ["Chair", "Table"]
for x in numbers:
for y in items:
Which statement will check if a is equal to b?