Program to find the maximum number from the list

In this program, we will find the maximum number from the list.

Steps to solve the program
  1. Take a list as input and create a variable to find the maximum number from the list and assign its value equal to 0.
  2. Use for loop to iterate over the list elements.
  3. If an element from the list is greater than the variable that we have created then change the value of the variable by that element.
  4. Print the output.
				
					list1 = [12,14,45,88,63,97,88]
max_ = 0

for i in list1:
    if i > max_:
        max_ = i
        
print("Maximum number: ",max_)
				
			

Output :

				
					Maximum number:  97
				
			

add elements from one list to another list and print It in descending order

Print the following pattern

Leave a Comment