Choose the correct option for the below script
>>> a = (1, 2, 3) >>> type(a) <class 'tuple'> >>> b = (3) >>> type(b)
>>> 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)
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
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()
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
import turtle as t
t. speed(0)
t.bgcolor('black')
t.pencolor('yellow')
for i in range(150):
t.right(i)
t.circle(125, i)
t.forward(i)
t.right(90)
t.done()
t. speed(0)
t.bgcolor('black')
t.pencolor('yellow')
for i in range(150):
t.right(i)
t.circle(125, i)
t.forward(i)
t.right(90)
t.done()
👍5
import turtle
turtle.speed(10)
def circle(radius,color):
turtle.color(color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
turtle.goto(-30,-280)
circle(300,'red')
turtle.goto(-30,-240)
circle(260,'white')
turtle.goto(-30,-200)
circle(220,'red')
turtle.goto(-30,-160)
circle(180,'blue')
turtle.goto(-200,75)
turtle.begin_fill()
turtle.color('white')
for i in range(5):
turtle.forward(340)
turtle.right(144)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
turtle.speed(10)
def circle(radius,color):
turtle.color(color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
turtle.goto(-30,-280)
circle(300,'red')
turtle.goto(-30,-240)
circle(260,'white')
turtle.goto(-30,-200)
circle(220,'red')
turtle.goto(-30,-160)
circle(180,'blue')
turtle.goto(-200,75)
turtle.begin_fill()
turtle.color('white')
for i in range(5):
turtle.forward(340)
turtle.right(144)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
👍4❤3