Adding as many examples as I've converted so far.
This commit is contained in:
1
3 - Variables and Basic Math/Challenge/README.md
Normal file
1
3 - Variables and Basic Math/Challenge/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Build a program that requests three numbers from the user, and performs a math operation on them and prints the result
|
||||
5
3 - Variables and Basic Math/Challenge/main.py
Normal file
5
3 - Variables and Basic Math/Challenge/main.py
Normal file
@@ -0,0 +1,5 @@
|
||||
firstValue = float(input("Value 1: "))
|
||||
secondValue = float(input("Value 2: "))
|
||||
thirdValue = float(input("Value 3: "))
|
||||
|
||||
print(str(firstValue) + " / " + str(secondValue) + " - " + str(thirdValue) + " = " + str(firstValue / secondValue - thirdValue))
|
||||
0
3 - Variables and Basic Math/README.md
Normal file
0
3 - Variables and Basic Math/README.md
Normal file
24
3 - Variables and Basic Math/main.py
Normal file
24
3 - Variables and Basic Math/main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
someString = "Some string value"
|
||||
lifeUniverseEverything = 42
|
||||
someFloat = 2.22
|
||||
bananasAreGood = True
|
||||
|
||||
string = input("Enter a string: ")
|
||||
intValue = int(input("Enter an integer: "))
|
||||
booleanValue = True if input("Enter a True/False value: ") == 'True' else False
|
||||
floatValue = float(input("Enter a float (decimal) value: "))
|
||||
|
||||
print("The values you entered")
|
||||
print("String: " + string)
|
||||
print("Integer: " + str(intValue))
|
||||
print("Boolean: " + str(booleanValue))
|
||||
print("Float: " + str(floatValue))
|
||||
|
||||
firstNumber = float(input("Enter the first floating (decimal) value: "))
|
||||
secondNumber = float(input("Enter the second floating (decimal) value: "))
|
||||
|
||||
print(str(firstNumber) + " + " + str(secondNumber) + " = " + str(firstNumber + secondNumber))
|
||||
print(str(firstNumber) + " - " + str(secondNumber) + " = " + str(firstNumber - secondNumber))
|
||||
print(str(firstNumber) + " * " + str(secondNumber) + " = " + str(firstNumber * secondNumber))
|
||||
print(str(firstNumber) + " / " + str(secondNumber) + " = " + str(firstNumber / secondNumber))
|
||||
print(str(int(firstNumber)) + " % " + str(int(secondNumber)) + " = " + str(int(firstNumber) % int(secondNumber)))
|
||||
Reference in New Issue
Block a user