From d842b39c61a35ff91cf63092d835fbf26e7b8151 Mon Sep 17 00:00:00 2001 From: Ashvatthaa Date: Fri, 6 Dec 2024 14:16:01 +0100 Subject: [PATCH 1/3] fixes --- problems/easy/easy_q1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/problems/easy/easy_q1.py b/problems/easy/easy_q1.py index 50fa9f4..0560904 100644 --- a/problems/easy/easy_q1.py +++ b/problems/easy/easy_q1.py @@ -5,3 +5,4 @@ print("{0} is Odd".format(num)) else: print("{0} is Even".format(num)) +#TEsting \ No newline at end of file From c5723813b18d694ddc51817ab4c7e6f9a045f894 Mon Sep 17 00:00:00 2001 From: Ashvatthaa Date: Fri, 6 Dec 2024 14:22:22 +0100 Subject: [PATCH 2/3] Bugs Fixed for Largest number problem --- problems/easy/easy_q1.py | 3 +-- problems/easy/easy_q2.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/problems/easy/easy_q1.py b/problems/easy/easy_q1.py index 0560904..2fd320a 100644 --- a/problems/easy/easy_q1.py +++ b/problems/easy/easy_q1.py @@ -1,8 +1,7 @@ # Check Even or Odd: Write a program to check if a given number is even or odd. num = int(input("Enter a number: ")) -if (num % 2) != 0: +if (num % 2) != 0: print("{0} is Odd".format(num)) else: print("{0} is Even".format(num)) -#TEsting \ No newline at end of file diff --git a/problems/easy/easy_q2.py b/problems/easy/easy_q2.py index 8c49830..ec4d7b3 100644 --- a/problems/easy/easy_q2.py +++ b/problems/easy/easy_q2.py @@ -1,11 +1,11 @@ # Find the Largest Number: Accept two numbers and print the larger one. def largest_of_two(a, b): if a > b: - return b + return a else: - return a + return b if __name__ == "__main__": num1 = int(input("Enter the First Number :")) num2 = int(input("Enter the Second Number :")) - res = largest_of_two(num1,num1) + res = largest_of_two(num1,num2) print(res) \ No newline at end of file From b37c33c928c7063e2c16de6df97c86c662bd5e88 Mon Sep 17 00:00:00 2001 From: Ashvatthaa Date: Fri, 6 Dec 2024 14:31:06 +0100 Subject: [PATCH 3/3] I have changed the input statement and also few changes in conditions --- problems/easy/easy_q5.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/problems/easy/easy_q5.py b/problems/easy/easy_q5.py index fbfab0b..ba7f110 100644 --- a/problems/easy/easy_q5.py +++ b/problems/easy/easy_q5.py @@ -2,16 +2,16 @@ def grade_system(marks): if marks >= 90: - return "B" + return "A" elif marks >= 80: - return "A" + return "B" elif marks >= 70: - return "F" + return "C" else: - return "C" + return "F" if __name__ == "__main__": - num = input("Enter the Mark : ") + num = int(input("Enter the Mark : ")) res = grade_system(num) print(res)