import sys
sys.argv
What is the output of the following code segment?
chr(ord('S'))
Which keyword is used for function in Python language? a function is defined in
Find the output of the following code:
l=['a',14,4,'b','&',':', 5]
del l[:]
print(l)
Which of the following is not a principle of object-oriented programming?
What is the output of the following code?
l = {1, 2, 5, 2, 5, 68, 33, 5, 1}
print(l[::-1])
>>> class A:
a = 10
>>> class B(A):
b = 20
>>> issubclass(B, A)
>>> issubclass(A, B)
What does the above code print?
What is the output of the following code?
for char in 'PYTHON STRING':
if char == ' ':
break
print(char, end='')
if char == 'O':
continue
What will be the output of the following Python code?
class Apple:
type = "Kashmir"
rate = 10
apple = Apple()
print(apple.type, apple.rate)
What will be the output of the following Python code?
names1 = ['Amir', 'Bear', 'Charlton', 'Daman']
names2 = names1
names3 = names1[:]
names2[0] = 'Alice'
names3[1] = 'Bob'
sum = 0
for ls in (names1, names2, names3):
if ls[0] == 'Alice':
sum += 1
if ls[1] == 'Bob':
sum += 10
print(sum)