Skip to content

Commit 4d95e8e

Browse files
Add files via upload
1 parent f16c4c0 commit 4d95e8e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Diff for: Learn-Python/Fun with numbers/Adding currency.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Taking input and converting into float
2+
x = float(input("Enter a number: "))
3+
y = float(input("Enter another number: "))
4+
5+
#Estimating and printing the result
6+
z = (x + y)
7+
print(f"{z:,}")

Diff for: Learn-Python/Fun with numbers/Estimated result.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Taking input and converting into float
2+
x = float(input("Enter a number: "))
3+
y = float(input("Enter another number: "))
4+
5+
#Estimating and printing the result
6+
z = round(x + y)
7+
print(z)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Taking input from the user
2+
x = input("Enter a number: ")
3+
y = input("Enter another number: ")
4+
5+
# Converting string into float
6+
x = float()
7+
y = float()
8+
9+
#Calculating (adding) and printing the result
10+
z = x + y
11+
"""
12+
for subtraction z = x - y
13+
for multiplication z = x * y
14+
for division z = x / y
15+
"""
16+
print(z)

0 commit comments

Comments
 (0)