Python Learning ...
194 subscribers
32 photos
1 file
29 links
Learn python programming language
Download Telegram
What is output of the following 🧠🖥🤔
print(math.pow(5, 2))?
Anonymous Quiz
44%
25
32%
25.0
10%
None
14%
Error
👍2
👍3
>>> tup = ("1234")
>>> print(type(tup))
Anonymous Quiz
45%
string
18%
error
33%
tuple
3%
none
a="2"
b="2"
print(a+b)
Anonymous Quiz
38%
'22'
20%
'4'
25%
4
17%
Error
👍3
In Python, what is the default maximum level of recursion?
Anonymous Quiz
17%
500
24%
1000
26%
10000
32%
None of the above
Choose the correct option for the below script

>>> a = (1, 2, 3) >>> type(a) <class 'tuple'> >>> b = (3) >>> type(b)
Anonymous Quiz
31%
<class 'int'>
59%
<class 'tuple'>
10%
<class 'list'>
python supports the creation of anonymous function at runtime, using a construct called________
Anonymous Quiz
22%
pi
34%
anonymous
38%
lambda
7%
none of the mentioned
👍1
what will be the output of the following python function? len(["hello",2,4,6])
Anonymous Quiz
34%
error
18%
6
36%
4
12%
3
👍1
python will be the output of the following python function? min(max(False,-3,-4),2,7)
Anonymous Quiz
11%
-4
25%
-3
28%
2
36%
False
👍1
What will be the output of the following Python code snippet?🤔🖥🧠
for i in [1, 2, 3, 4][::-1]: print (i)
Anonymous Quiz
25%
1 2 3 4
46%
4 3 2 1
22%
Error
7%
none of the above
👍1
Which of the following blocks allows you to test the code blocks for errors?🖥🧠🤔
Anonymous Quiz
34%
except block
41%
try block
15%
finally block
10%
none of the above
👍1
what datatype are the *args stored, when passed into a function? 🧠🤔🖥
Anonymous Quiz
37%
lists
38%
tuples
16%
dictionaries
9%
none of the above
👍2
import turtle

t = turtle.Turtle()
s = turtle.Screen()
s.bgcolor('black')
t.speed(0)
col = ('gold', 'cyan')

for i in range(300):
t.pencolor(col[i%2])
t.width(2)
t.forward(i)
t.right(89)
t.forward(i*2)
t.right(89)

turtle.done()
👍1
import turtle as t
import colorsys
t.bgcolor('black')
t.pencolor('cyan')
t.tracer(2)
t.hideturtle()

def VastCoding():
for i in range(4):
t.fd(200)
t.right(90)

for j in range(500):
VastCoding()
t.goto(0, 0)
t.rt(2)

t.exitonclick()
import turtle as t
import colorsys
t.bgcolor('black')
t.tracer(2)
hue = 0.3
t.hideturtle()

def VastCoding():
global hue
for i in range(4):
color = colorsys.hsv_to_rgb(hue, 1,1)
hue+= 0.010
t.pencolor(color)
t.fd(200)
t.right(90)

for j in range(500):
VastCoding()
t.goto(0, 0)
t.rt(2)

t.exitonclick()
🔥1
import turtle
import colorsys

t = turtle.Turtle()
s = turtle.Screen()
s.colormode(255)
t.speed(0)
t.width(2)
s.bgcolor('black')
t.pencolor(110, 222, 22)

def shape(angle, side, limit):
reverseDirection = 200
t.fd(side)

if side % (reverseDirection*2) == 0:
angle =angle +2
print(side)

elif side % reverseDirection == 0:
angle = angle-2
print(side)
t.right(angle)
side = side + 2

if side < limit:
shape(angle, side, limit)
angle = 119
side = 0
limit = 600
shape(angle, side, limit)
turtle.done()
🔥1
from turtle import *

bgcolor('black')
speed(0)

for i in range(180):
color('red')
circle(i)
color('yellow')
circle(i*0.7)
right(9)
forward(2)

done()
🔥1