Advertisement
DrAungWinHtut

List0.py

Mar 18th, 2023
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. total = 0
  2. avg = 0
  3. sub = ['myn', 'eng', 'maths']
  4. marks1 = [55, 66, 67]
  5. marks1 = marks1 * 3
  6. print(marks1)
  7. print()
  8.  
  9. marks = [45, 67, 88, 45, 36, 77]
  10. marks = marks1 + marks
  11. print(marks)
  12. print()
  13.  
  14.  
  15. del marks[0]
  16. print(marks)
  17. print()
  18.  
  19. for m in marks:
  20.     total += m
  21.  
  22. avg = total / len(marks)
  23.  
  24. print('avg = ', avg)
  25.  
  26. if 77 in marks:
  27.     print('77 include')
  28. else:
  29.     print('77 not include')
  30.  
  31.  
  32. print('maximum marks is ', max(marks))
  33. print('minimum marks is ', min(marks))
  34. print('100 count is ', marks.count(100))
  35. print('first index of 66 ', marks.index(66))
  36. print('first index of 88 ', marks.index(88))
  37. marks.insert(7, 100)
  38. print(marks)
  39. print('first index of 88 ', marks.index(88))
  40. marks.remove(55)
  41. print(marks)
  42. print('first index of 88 ', marks.index(88))
  43. marks.reverse()
  44. print(marks)
  45. marks.sort(reverse=True)
  46. print(marks)
  47. marks.pop()
  48. marks.pop(marks.index(100))
  49. print(marks)
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement