Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # כתבו פונקציה שמקבלת רשימה, ומחזירה את מיקום המופע האחרון של האיבר הראשון ברשימה.
- # לדוגמה, עבור הרשימה [1, 2, 3, 5, 1, 2] החזירו 4, כיוון ש־1 מופיע פעם אחרונה במקום 4 ברשימה.
- #
- test_list = ['G', 'e', 'e', 'k', 's', 'f', 'o', 'r','g', 'e', 'e', 'k', 's']
- find_me = 'e'
- place = 0
- i = 0
- while i < len(test_list):
- if find_me == test_list[i]:
- place = i
- i += 1
- print(place)
Advertisement
Add Comment
Please, Sign In to add comment