Update day_5.py

corrected error from printing reversed list variables
This commit is contained in:
dorindabassey 2021-02-21 00:10:04 +01:00 committed by GitHub
parent ee04d2323d
commit 6e601719f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)