Question:4
Write a python script to make a function to take input for 3 numbers check and print the maximum number.
Sol:
#function definition def largest(): a=int(input("Enter 1st no ")) b=int(input("Enter 2nd no ")) c=int(input("Enter 2nd no ")) if(a>b and a>c): m=a elif(b>c): m=b else: m=c print("Max no = ",m) #function calling largest()
#Output Enter 1st no 25 Enter 2nd no 96 Enter 2nd no 3 Max no = 96 >>>
Question:5
Write a python script to make a function to take input for 3 numbers check and print the lowest number.
Sol:
#function definition def lowest(): a=int(input("Enter 1st no ")) b=int(input("Enter 2nd no ")) c=int(input("Enter 2nd no ")) if(a<b and a<c): m=a elif(b<c): m=b else: m=c print("Min no = ",m) #function calling lowest()
#Output: Enter 1st no 25 Enter 2nd no 963 Enter 2nd no 4 Min no = 4 >>>