AS_CBSE_VIII_Computer Studies_Ch 7_Python_Lists Functions and Modules (1)
AS_CBSE_VIII_Computer Studies_Ch 7_Python_Lists Functions and Modules (1)
print(flowers[3:])
b. colours=["green","blue","red","purple"]
print(colours[1])
colours=["green","blue","red","purple"]
colours.pop()
d. num=84.5368
rounded_num=round(num,1)
print(rounded_num)
e import random
def select_num():
return random.randint(1,3)
select_num_output=select_num()
print(select_num_output)
i. Prints number 1
ii. Prints number 2 only
only
i.
ii.
iii.
iv.
Ans
.
Q.3 Observe the Python code given below and write the [An
correct output for each code. ]
a. student_name=['Navya','Amit']
length=len(student_name)
b. import math
print(math.pow(2,4))
Ans 16.0
.
c. num=[5,10,15,20]
value=type(num)
Lab Activity
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>