What is the output of the program?
nums=[]
print(nums)
What is the output of the following code:
import math
print(math.pow(5, 3))
What will be the output of the following Python code?
str = "hello"
print(str[:2])
Which of the following import statements for the os module in Python is recommended?
What is the output of the following code?
x = 'abcd'
for i in range(len(x)):
x[i] = x[i].upper()
print(x)
What will be the output of the following code?
import functools as f
a = [125, 100, 5, 4, 3, 2, 1]
b = f.reduce(lambda x, y: x - y, a)
print(b)
What is the output of the following piece of code when executed in Python shell?
a = "Check" * 3
import turtle
t=turtle.Pen()
t.color(0,1,0)
t.begin_fill()
for i in range(0,4):
t.forward(100)
t.right(90)
nums = range(2, 50)
for i in range(2, 8):
nums = list(filter(lambda x: x == i or x % i, nums))
print (nums)