Hey If you are beginner and want to learn a python then you are on right path. Learn basic as well as advanced programming in Python.

Search

Python program to find the maximum number in list without using built in function.

PYTHON PROGRAM




n=int(input("Enter array size:"))

a=[]

print("Enter",n,"elements in Array:")

for k in range(0,n):

s=int(input())

a.append(s)

max=a[0]

for i in range(0,n):

if max>=a[i]:

max=max

else:

max=a[i]

print("Maximum number in Array=",max)





*** Input && Output ***





No comments:

Post a Comment

let me know which type examples you want to comment me.