From 03ae2e365784dcf5dc21f214e56007a5975335d0 Mon Sep 17 00:00:00 2001 From: maddy290888 Date: Fri, 14 Jul 2023 10:33:09 +0530 Subject: [PATCH 1/2] Create solution_3_vishnu.txt --- .../Code Snippet Exercise-III/solution_3_vishnu.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 14 July (Live Session Submission)/Code Snippet Exercise-III/solution_3_vishnu.txt diff --git a/14 July (Live Session Submission)/Code Snippet Exercise-III/solution_3_vishnu.txt b/14 July (Live Session Submission)/Code Snippet Exercise-III/solution_3_vishnu.txt new file mode 100644 index 0000000..1b577c2 --- /dev/null +++ b/14 July (Live Session Submission)/Code Snippet Exercise-III/solution_3_vishnu.txt @@ -0,0 +1,2 @@ +-5.0 +a/b result in 0 From 48ff8b1f2fca414a2fc8a6c5493e05e7b10c986f Mon Sep 17 00:00:00 2001 From: maddy290888 Date: Fri, 14 Jul 2023 12:23:42 +0530 Subject: [PATCH 2/2] Create lab1_Sol_vishnu.py --- .../lab1_Sol_vishnu.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 14 July (Live Session Submission)/lab1_Sol_vishnu.py diff --git a/14 July (Live Session Submission)/lab1_Sol_vishnu.py b/14 July (Live Session Submission)/lab1_Sol_vishnu.py new file mode 100644 index 0000000..39b1b18 --- /dev/null +++ b/14 July (Live Session Submission)/lab1_Sol_vishnu.py @@ -0,0 +1,13 @@ +import pandas as pd + +df = pd.read_excel("Iterator-Lab.xlsx",sheet_name = 0) +device_list = list(df['Device']) +current_list = list(df['Current']) +power_list = list(df['Power']) + +sorted_power_list = sorted(power_list,reverse = True) + +highest_power_dx = power_list.index(sorted_power_list[0]) +second_power_dx = power_list.index(sorted_power_list[1]) +print(f"Top power rating devices are \n{device_list[highest_power_dx]} Current- {current_list[highest_power_dx]}\n" + f"{device_list[second_power_dx]} Current- {current_list[second_power_dx]}" )