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