1. #Write a function to find the max of two numbers a=int(input("a : ")) b=int(input("b : ")) if a>b : print(f'the max of a,b is : {a}') else : print(f' the max of a,b is : {b}') 2. #create a function that takes a number as input and returns whether it is even or odd num=int(input("Enter a number : ")) if num%2!=0: print("Odd") else: print("Even") 3. #write a program to find the area of the rectangle given its length and width length=int(input("Length : ")) width=int(input("Width : ")) AOR=0.5*(length*width) print(f'Area of Rectangle = {AOR}') 5. #create a program that calculates the factorial of a number num=int(input()) factorial=1 for i in range(1,num+1): factorial*=i print(f' Factorial of {num} is : {factorial}') 7. # program to check if the given number is prime n= int(input('Enter a number :')) count=0 for i in range(2,n,1): if n % i ==0: print('not a prime number ') count=1 break if count==0 : print('It is a Prime Number') 8. #create a program that calculates the sum of all numbers in the list List=[3,7,8,2,9,1] Sum=0 for i in List: Sum+=i print(f'The sum of all the values in the list : {Sum}') 10. #write a program that calculates the length of a string without using len() function strng=("SAI") length=0 for alphs in strng: length+=1 print(f' length of a string is : {length}')