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 = 100
b = 200
The simplest possible class definition in Python can be expressed as
Anonymous Quiz
17%
class X: return
18%
class X: { }
33%
class X:
32%
class X: pass
Code snippet:
def example(a):
a = a + '2'
a = a*2
return a

print(example("hello"))
Code snippet:
func = lambda x: return x
print(func(2))
Code snippet:
from numbers import Number
from decimal import Decimal
from fractions import Fraction

print(isinstance(2.0, Number), end = ' ')
print(isinstance(Decimal('2.0'), Number), end = ' ')
print(isinstance(Fraction(2, 1), Number), end = ' ')
print(isinstance("2", Number), end = ' ')
Code snippet:
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
Code snippet:
from functools import reduce
numbers = [1, 2, 3]
reduce(lambda x, y: x + y, numbers)
Code snippet:
x=1
def cg():
global x
x=x+1
cg()
x
Code snippet:
def foo(k):
k = [1]
q = [0]
foo(q)
print(q)