Jash Pancholi, F025
1.
from functools import reduce
l = [5, 4, 5]
sum = reduce((lambda x, y: x * y), l)
print (sum)
2.
def func(n):
for i in range(1,11):
print(f"{n} x {i} = {n*i}")
n=int(input())
func(n)
3.
add=lambda x: x + 26
mult=lambda x,y: x*y
x=int(input("enter x, x will be added to 26: "))
y=int(input("enter y, x,y will be multiplied: "))
print(f"x + 26 = {add(x)}")
print(f"x * y = {mult(x,y)}")
Jash Pancholi, F025
4.
def fib():
a,b=0,1
f=[]
for i in range(1,11):
f.append(a)
a,b=b,a+b
return f
l=[]
l=fib()
print(l)
l1=map(lambda x:x*x,l)
print(list(l1))
5.
l=[1,2,3,4,5,6,7]
l1=map(lambda x:x*x*x,l)
print(list(l1))
Jash Pancholi, F025
6.
l = [1,2,3,4,5,6,7,8,9]
final_list = filter(lambda x: ( x % 2 == 0) , l)
print(list(final_list))
7.
l=[1,2,3,4,5,6,7]
l1=map(lambda x:x*x*x,l)
final_list=filter(lambda x:(x%2==0),l1)
print(list(final_list))