From 03a3bbdfb361fcb3a755bb1c3b0f48f71f791654 Mon Sep 17 00:00:00 2001 From: jasmeen Date: Tue, 23 Sep 2025 07:13:32 +0530 Subject: [PATCH 1/4] my doubts --- ex03.py | 7 +++++++ ex04.py | 8 ++++++++ ex11.py | 16 ++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/ex03.py b/ex03.py index d0da21d..40f62e4 100755 --- a/ex03.py +++ b/ex03.py @@ -21,3 +21,10 @@ print("It is greater?", 5 > -2) print("It is greater or equal?", 5 >= -2) print("It is less or equal?", 5 <= -2) + +# Notice the math seems “wrong”? There are no fractions, only whole numbers. Find out +#why by researching what a “fl oating point” number is. + + + + diff --git a/ex04.py b/ex04.py index 8e5e161..1cfc1f9 100755 --- a/ex04.py +++ b/ex04.py @@ -13,3 +13,11 @@ print("We can transport", carpool_capacity, "people today.") print("We have", passengers, "to carpool today.") print("We need to put about", average_passengers_per_car, "in each car.") + +# What do you mean by “read the fi le backward”? +#Very simple. Imagine you have a fi le with 16 lines of code in it. Start at line 16, and compare it to +# my file at line 16. Then do it again for 15, and so on, until you’ve read the whole fi le backward. + +#Why does / (divide) round down? +#It’s not really rounding down; it’s just dropping the fractional part after the decimal. Try doing +#7.0 / 4.0 and compare it to 7 / 4 and you’ll see the difference. \ No newline at end of file diff --git a/ex11.py b/ex11.py index 253a825..2fd5292 100755 --- a/ex11.py +++ b/ex11.py @@ -6,3 +6,19 @@ weight = input() print(f"So, you're {age} old, {height} tall and {weight} heavy.") + + +# Below is the output where I gave input as string and number. +# input() take as string and then we have to convert it to integer but here we are not converting. + +# jas@jasmeen-E490:~$ /usr/bin/python3 /home/jas/Downloads/ex1.py +# How old are you? two +# How tall are you? two +# How much do you weight? two +# So, you're two old, two tall and two heavy. + +# jas@jasmeen-E490:~$ /usr/bin/python3 /home/jas/Downloads/ex1.py +# How old are you? 33 +# How tall are you? 5.5 +# How much do you weight? 65 +# So, you're 33 old, 5.5 tall and 65 heavy. \ No newline at end of file From 79841b3c41fc301ecc3cde87cf1883867000f23d Mon Sep 17 00:00:00 2001 From: jasmeen Date: Tue, 23 Sep 2025 07:20:36 +0530 Subject: [PATCH 2/4] update issue --- ex03.py | 1 + ex11.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ex03.py b/ex03.py index 40f62e4..d5bda23 100755 --- a/ex03.py +++ b/ex03.py @@ -28,3 +28,4 @@ + diff --git a/ex11.py b/ex11.py index 2fd5292..8cb48b0 100755 --- a/ex11.py +++ b/ex11.py @@ -21,4 +21,4 @@ # How old are you? 33 # How tall are you? 5.5 # How much do you weight? 65 -# So, you're 33 old, 5.5 tall and 65 heavy. \ No newline at end of file +# So, you're 33 old, 5.5 tall and 65 heavy. From 6bb7bba05d489f570cb86a02dbd3655b6b6dc2d4 Mon Sep 17 00:00:00 2001 From: jasmeen92 Date: Sun, 28 Sep 2025 12:03:23 +0530 Subject: [PATCH 3/4] update issue --- ex03.py | 7 +++++-- ex04.py | 2 +- ex13.py | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/ex03.py b/ex03.py index d5bda23..111bcac 100755 --- a/ex03.py +++ b/ex03.py @@ -22,8 +22,11 @@ print("It is greater or equal?", 5 >= -2) print("It is less or equal?", 5 <= -2) -# Notice the math seems “wrong”? There are no fractions, only whole numbers. Find out -#why by researching what a “fl oating point” number is. + + +# Notice the math seems “wrong”? There are no fractions, only whole numbers. +# yes the maths is wrong. +# floating number i read. diff --git a/ex04.py b/ex04.py index 1cfc1f9..b8b20ea 100755 --- a/ex04.py +++ b/ex04.py @@ -14,7 +14,7 @@ print("We have", passengers, "to carpool today.") print("We need to put about", average_passengers_per_car, "in each car.") -# What do you mean by “read the fi le backward”? +# What do you mean by “read the file backward”? #Very simple. Imagine you have a fi le with 16 lines of code in it. Start at line 16, and compare it to # my file at line 16. Then do it again for 15, and so on, until you’ve read the whole fi le backward. diff --git a/ex13.py b/ex13.py index 0f7981b..c163a3a 100755 --- a/ex13.py +++ b/ex13.py @@ -7,3 +7,40 @@ print("Your first variable is:", first) print("Your second variable is:", second) print("Your third variable is:", third) + +# in below script, I dont understand how come ex1.py came in place of script. why not script + +# jas@jasmeen-E490:~/Downloads$ python3 ex1.py first second third +# The script is called: ex1.py +# Your first variable is: first +# Your second variable is: second +# Your third variable is: third + +################################################################# + +# in below script i tried giving argv as input from user but i do not get the expected output + +# from sys import argv + +# # read the WYSS section for how to run this + +# age = input("How old are you? ") +# height = input("How tall are you? ") +# weight = input("How much do you weight? ") + + +# script, age, height, weight = argv + +# print("The script is called:", script) +# print("Your age is:", age) +# print("Your height is:", height) +# print("Your weight is:", weight) + +# jas@jasmeen-E490:~/Downloads$ python3 ex1.py age height weight +# How old are you? 33 +# How tall are you? 5.6 +# How much do you weight? 65 +# The script is called: ex1.py +# Your age is: age +# Your height is: height +# Your weight is: weight \ No newline at end of file From 536f7d9bf7e65685d650a4b42f6352fe03cdef86 Mon Sep 17 00:00:00 2001 From: jasmeen92 Date: Sun, 28 Sep 2025 12:07:17 +0530 Subject: [PATCH 4/4] update issue --- ex13.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ex13.py b/ex13.py index c163a3a..648435f 100755 --- a/ex13.py +++ b/ex13.py @@ -8,7 +8,7 @@ print("Your second variable is:", second) print("Your third variable is:", third) -# in below script, I dont understand how come ex1.py came in place of script. why not script +# in below script, I dont understand how come ex1.py came in place of script. why not scripts # jas@jasmeen-E490:~/Downloads$ python3 ex1.py first second third # The script is called: ex1.py @@ -18,11 +18,10 @@ ################################################################# -# in below script i tried giving argv as input from user but i do not get the expected output +# in below script i tried giving argv as input from user but why the output is not number in line 43, 44, 45 # from sys import argv -# # read the WYSS section for how to run this # age = input("How old are you? ") # height = input("How tall are you? ")