Write a python program to find maximum between four numbers.
Answers
Answered by
1
Answer:
This can be done in two ways:
1. Using max function in the built-in library
2. Using for loop
I have given the answers with both the ways
Explanation:
1. max function
l=eval(input("Enter a list with four elements"))
print("Largest number", max(l))
2. Using for loop
l=eval(input("Enter a list with four elements"))
m=0 #m is any variable to store max value
for i in l:
if (m<i):
m=i
print("Largest number",m)
Please mark this as the brainliest. Thank you! I hope I was able to write an efficient code.
Similar questions