mirror of
https://github.com/Asabeneh/30-Days-Of-Python.git
synced 2026-06-12 21:01:48 +08:00
Update day_5.py
corrected error from printing reversed list variables
This commit is contained in:
parent
ee04d2323d
commit
6e601719f4
@ -161,10 +161,10 @@ print(ages.index(24))
|
||||
# Reverse
|
||||
fruits = ['banana', 'orange', 'mango', 'lemon']
|
||||
fruits.reverse()
|
||||
print(fruits.reverse())
|
||||
print(fruits)
|
||||
ages = [22, 19, 24, 25, 26, 24, 25, 24]
|
||||
ages.reverse()
|
||||
print(ages.reverse())
|
||||
print(ages)
|
||||
|
||||
# sort
|
||||
fruits = ['banana', 'orange', 'mango', 'lemon']
|
||||
@ -176,4 +176,4 @@ ages = [22, 19, 24, 25, 26, 24, 25, 24]
|
||||
ages.sort()
|
||||
print(ages)
|
||||
ages.sort(reverse=True)
|
||||
print(ages)
|
||||
print(ages)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user