fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']
>>> fruits.count('apple')
Which of the following data types in Python are immutable?
What is the output of the following code?
print("x" is "x", [] is [])
The <div> element that wraps a new empty block is called which of the following?
What will be the output of the following Python code?
x = [12, 34]
print(len(''.join(list(map(int, x)))))
What is the average value of the following Python code snippet?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
Identify the type of errors in the following Python code:
print("Good Morning")
print("Good night")
Deduce the output of the following code:
b=0
c=0
for i in range(1, 6):
if i == 3:
break
b+=i
for i in range(1, 6):
if i == 3:
continue
c+=i
print(b+c)
What will be the output of the following Python code?
def arithmetic(a, b, c):
e = a * b * c
d = e - 10
f = d // 2
return f
a = arithmetic(2, 3, 4)
print(a)
What is the output of the following code?
class Test:
def __init__(self):
self.x = 0
class Derived_Test(Test):
def __init__(self):
self.y = 1
def main():
b = Derived_Test()
print(b.x,b.y)
main()