Facebook
From kush, 1 Year ago, written in Plain Text.
This paste is a reply to file handling 12 from kush - view diff
Embed
Download Paste or View Raw
Hits: 171
  1. a=int(input())
  2. l=list()
  3. v=list()
  4. count=0
  5. for i in range(a):
  6.     ele=int(input())
  7.     l.append(ele)
  8. one=l.count(1)
  9. two=l.count(2)
  10. three=l.count(3)
  11. v.append(one)
  12. v.append(two)
  13. v.append(three)
  14. for i in range(a):
  15.     if(l[i]!=1 and l[i]!=2 and l[i]!=3):
  16.         count+=1
  17. q=max(v)
  18. if((v.count(q))==2 or (v.count(q))==3):
  19.     print(one)
  20.     print(two)
  21.     print(three)
  22.     print(count)
  23.     print("Trip cancelled")
  24. elif(q==one):
  25.     print(one)
  26.     print(two)
  27.     print(three)
  28.     print(count)
  29.     print("Madikeri")
  30. elif(q==two):
  31.     print(one)
  32.     print(two)
  33.     print(three)
  34.     print(count)
  35.     print("Mysore")
  36. elif(q==three):
  37.     print(one)
  38.     print(two)
  39.     print(three)
  40.     print(count)
  41.     print("Mangalore")

Replies to lists 8 rss

Title Name Language When
lists 10 kush text 1 Year ago.