diff --git a/04_Day_Strings/day_4.py b/04_Day_Strings/day_4.py index 54e59464b..2562ffea1 100644 --- a/04_Day_Strings/day_4.py +++ b/04_Day_Strings/day_4.py @@ -129,7 +129,7 @@ radius = 10 pi = 3.14 -area = pi # radius ## 2 +area = pi * radius ** 2 result = 'The area of circle with {} is {}'.format(str(radius), str(area)) print(result) # The area of circle with 10 is 314.0 diff --git a/05_Day_Lists/day_5.py b/05_Day_Lists/day_5.py index 6b9c2a1f7..cdf4c438f 100644 --- a/05_Day_Lists/day_5.py +++ b/05_Day_Lists/day_5.py @@ -8,7 +8,7 @@ animal_products = ['milk', 'meat', 'butter', 'yoghurt'] # list of animal products web_techs = ['HTML', 'CSS', 'JS', 'React', 'Redux', - 'Node', 'MongDB'] # list of web technologies + 'Node', 'MongoDB'] # list of web technologies countries = ['Finland', 'Estonia', 'Denmark', 'Sweden', 'Norway'] # Print the lists and it length @@ -164,13 +164,14 @@ print(fruits.index('orange')) # 1 ages = [22, 19, 24, 25, 26, 24, 25, 24] 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']