From 41b4511474458ec46263361f35a270ec5dd3dc87 Mon Sep 17 00:00:00 2001 From: Fayyaz Ahmad Date: Mon, 6 Jul 2026 19:59:17 +0500 Subject: [PATCH] done --- Chapter 2 - PS/02_problem2.py | 5 ++++- Chapter 2 - PS/03_problem3.py | 4 +++- Chapter 2 - PS/04_problem4.py | 8 ++++++-- Chapter 2 - PS/05_problem5.py | 3 ++- Chapter 2 - PS/06_problem6.py | 3 ++- Chapter 3 - PS/03_problem3.py | 2 +- Chapter 3/01_intro_to_strings.py | 7 ++++++- Chapter 4 - PS/03_problem3.py | 3 ++- Chapter 5 - PS/09_problem9.py | 3 ++- Chapter 5/01_dict.py | 2 +- Chapter 5/02_dict_methods.py | 10 +++++----- Chapter 7 - PS/02_problem2.py | 2 +- Chapter 7/01_loops.py | 12 ++++++------ Chapter 8 - PS/01_problem1.py | 2 ++ 14 files changed, 43 insertions(+), 23 deletions(-) diff --git a/Chapter 2 - PS/02_problem2.py b/Chapter 2 - PS/02_problem2.py index 3b9c128..0786c37 100644 --- a/Chapter 2 - PS/02_problem2.py +++ b/Chapter 2 - PS/02_problem2.py @@ -2,4 +2,7 @@ b = 5 -print("Remainder when a is divided by b is", a % b) \ No newline at end of file +print("Remainder when a is divided by b is", a % b) +name="fayyaz" +age= 20 +print("My name is", name, "and I am", age, "years old.") \ No newline at end of file diff --git a/Chapter 2 - PS/03_problem3.py b/Chapter 2 - PS/03_problem3.py index 1616c01..78ae588 100644 --- a/Chapter 2 - PS/03_problem3.py +++ b/Chapter 2 - PS/03_problem3.py @@ -1,2 +1,4 @@ a = input("Enter the value of a: ") -print(type(a)) \ No newline at end of file +print(type(a)) +b=input("add number 2: ") +print(type(b)) \ No newline at end of file diff --git a/Chapter 2 - PS/04_problem4.py b/Chapter 2 - PS/04_problem4.py index 4ef443f..688b189 100644 --- a/Chapter 2 - PS/04_problem4.py +++ b/Chapter 2 - PS/04_problem4.py @@ -1,4 +1,8 @@ a = int(input("Enter number 1: ")) b = int(input("Enter number 2: ")) - -print("a is greater than b is", a>b) \ No newline at end of file +c= a+b +print("The sum of a and b is", c) +if a>b: + print("a is greater than b") +if ab and a>c): return a elif(b>a and b>c): + print("The greatest number is: b") return b elif(c>b and c>a): + print("The greatest number is: c") return c a = 1