Top Python Quiz Questions 🐍
1.69K subscribers
81 photos
4 links
πŸŽ“πŸ”₯πŸ’Ύ If you want to acquire a solid foundation in Python and/or your goal is to prepare for the exam, this channel is definitely for you.
🀳Feel free to contact us - @topProQ
And if you are interested in Java https://t.me/topJavaQuizQuestions
Download Telegram
Code snippet:
a = ['hat', 'mat', 'rat']
'rhyme'.join(a)
Code snippet:
class Count:
def __init__(self, count=0):
self.__count=count
a=Count(2)
b=Count(2)
print(id(a)==id(b), end = '' '')

c= ''hello''
d= ''hello''
print(id(c)==id(d))
Code snippet:
first = bool('False')
second = bool()
print(str(first) + " " + str(second))
Code snippet:
x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)
Code snippet:
a, b, c = (1, 2, 3, 4, 5, 6, 7, 8, 9)[1::3]
Code snippet:
D = dict() 
for x in enumerate(range(2)):
D[x[0]] = x[1]
D[x[1]+7] = x[0]
print(D)
Code snippet:
class A():
def disp(self):
print("A disp()")
class B(A):
pass
obj = B()
obj.disp()
Code snippet
x=100
def f1():
global x
x=90
def f2():
global x
x=80
print(x)
Code snippet:
class A:
def __init__(self):
self.__i = 1
self.j = 5

def display(self):
print(self.__i, self.j)
class B(A):
def __init__(self):
super().__init__()
self.__i = 2
self.j = 7
c = B()
c.display()
Code snippet:
f=lambda x:bool(x%2)
print(f(20), f(21))