Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lowestHighest(students):
- lowest = students[0]
- highest = students[len(students)-1]
- for i in range(len(students)):
- if lowest > students[i]:
- lowest = students[i]
- if highest < students[i]:
- highest = students[i]
- if highest < lowest:
- highest, lowest = lowest, highest
- return lowest, highest
- lowest = 0
- highest = 0
- students = [10, 3, 6 , 7, 9, 5, 4]
- lowest, highest = lowestHighest(students)
- print(f"lowest: {lowest}, highest: {highest}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement