Saturday 3 August 2019

Assignment No: 03 Finding Max No & Min No in List Using Built-In Function

'''
Assignment No:3
To accept N numbers from user. Compute and display maximum in list, minimum in list,
sum and average of numbers using built-in function.
'''
try:
n = int(input("Enter no of elements: "))
nos_list = [] # nos_list list is created
for i in range(n): # for loop
num = int(input("Enter no: "))
nos_list.append(num) # numbers are added in nos_list list
maxNo = max(nos_list) # maximum number in list
minNo = min(nos_list) # minimum number in list
sumNos = sum(nos_list) # sum of numbers in list
average = sumNos/len(nos_list) # average of numbers in list
print('Max no is ',maxNo)
print('Min no is ',minNo)
print('Count: ',len(nos_list)) # length of list
print('Sum of nos is ',sumNos)
print('Average of nos is ',average)
except ValueError:
print('Enter n and all elements as integer.')


71 comments:

  1. Easily Understand

    ReplyDelete
  2. Easy concept... Understandable

    ReplyDelete
  3. Easy to understand and perform also

    ReplyDelete

  4. Urmila17 October 2019 at 01:39
    Easy concept... Understandable

    ReplyDelete
  5. Very nice program and easy to understand

    ReplyDelete
  6. Output of this programme max and min value are directly display
    So...
    This programme is very easy

    ReplyDelete
  7. Finding Max No & Min No in List Using Built-In Function I enjoyed this programme and also easy to understand 😊☺️😊

    ReplyDelete
  8. Very easy nice and creative program

    ReplyDelete
  9. Easy to calculate the max and min no in list.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. B-56-Lalit Patil
    It makes programming too easy...
    It's too good sir 🔥

    ReplyDelete
  12. B-19-shrutika hollar
    It's really excellent

    ReplyDelete
  13. B-11-Pratik Ghule
    understood

    ReplyDelete
  14. B-02-Ganesh Gaikwad
    Understand

    ReplyDelete
  15. B-13-Sonali Ghumare
    Easily understand

    ReplyDelete
  16. B20:-it was understanding lecture

    ReplyDelete
  17. B-19-Shrutika Holkar
    Clearly understood
    Very simple concepts

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. B-1 shrutika gaikwad
    It was ok

    ReplyDelete
  20. B-56-Lalit Patil
    Understood

    ReplyDelete
  21. B-29 Pooja kedar
    Understood

    ReplyDelete
  22. A1-roll no-02
    thank you so much

    ReplyDelete
  23. batch-A1
    roll no-05
    thank you sir

    ReplyDelete

Microsoft’s latest Surface Pro X is now available in India

  Microsoft Surface Pro X 2020 is now available in India at a starting price of Rs 1,49,999.  Here's everything you would like to unders...