Skip to content

Commit c536c5f

Browse files
PawelPawel
Pawel
authored and
Pawel
committed
Initial commit
0 parents  commit c536c5f

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

2.10.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A program that converts kilometers to miles
2+
3+
kilometers = eval(input("Enter distance in km: "))
4+
miles = kilometers * 0.62
5+
print(kilometers, "km is", miles, "miles.")

2.11.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# A program that converts gallons to liters
2+
3+
print("This program takes input in gallons and converts it to liters.")
4+
5+
gallons = eval(input("Enter fuel in gallons: "))
6+
liters = gallons * 3.785412
7+
print(gallons, "gallons is", liters, "liters.")

2.12.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A calculator
2+
3+
def main():
4+
print("This is a calculator.")
5+
print("Simply crash the program to exit.")
6+
7+
for i in range(0, 100):
8+
num = eval(input("Enter your expression here: "))
9+
print(num)
10+
11+
main()

2.9.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A program that converts Fahrenheit to Celsius
2+
3+
fahrenheit = eval(input("Enter tempereature in Fahrenheit: "))
4+
celsius = (fahrenheit - 32) / 1.8
5+
print(fahrenheit, "Fahrenheit is", celsius, "Celsius.")

0 commit comments

Comments
 (0)