diff --git a/ex03.py b/ex03.py index d0da21d..111bcac 100755 --- a/ex03.py +++ b/ex03.py @@ -21,3 +21,14 @@ 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. +# yes the maths is wrong. +# floating number i read. + + + + + diff --git a/ex04.py b/ex04.py index 8e5e161..b8b20ea 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 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. + +#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..8cb48b0 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. diff --git a/ex13.py b/ex13.py index 0f7981b..648435f 100755 --- a/ex13.py +++ b/ex13.py @@ -7,3 +7,39 @@ 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 scripts + +# 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 why the output is not number in line 43, 44, 45 + +# from sys import argv + + +# 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