Ed's 20240917 lecture
parent
329755e59e
commit
50247309aa
|
@ -1,8 +1,13 @@
|
||||||
|
|
||||||
data1 = 4
|
data1 = 4.
|
||||||
data2 = 11
|
data2 = 11
|
||||||
|
|
||||||
|
print("Data1 is ",type(data1))
|
||||||
|
print("Data2 is ",type(data2))
|
||||||
|
|
||||||
result = data1 + data2
|
result = data1 + data2
|
||||||
|
|
||||||
|
print("Result is ",type(result))
|
||||||
|
|
||||||
print(f"The sum is {result}")
|
print(f"The sum is {result}")
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
|
|
||||||
data1 = 4
|
data1 = input("Enter a value for data1: ")
|
||||||
data2 = 11
|
data1 = float(data1)
|
||||||
|
|
||||||
|
data2 = input("Enter a value for data2: ")
|
||||||
|
data2 = float(data2)
|
||||||
|
|
||||||
|
print("Data1 is ",type(data1))
|
||||||
|
print("Data2 is ",type(data2))
|
||||||
|
|
||||||
result = data1 + data2
|
result = data1 + data2
|
||||||
|
print("Result is ",type(result))
|
||||||
|
|
||||||
|
print("The sum is ",result)
|
||||||
|
|
||||||
print(f"The sum is {result}")
|
print(f"The sum is {result}")
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
data1 = 4.
|
data1 = 4.
|
||||||
data2 = 100000000000000000000000000
|
data2 = 3
|
||||||
|
|
||||||
result = data1 / data2
|
result = data1 / data2
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
data1 = input("Enter a value for data1: ")
|
||||||
|
data1 = float(data1)
|
||||||
|
|
||||||
|
data2 = input("Enter a value for data2: ")
|
||||||
|
data2 = float(data2)
|
||||||
|
|
||||||
|
print("Data1 is ",type(data1))
|
||||||
|
print("Data2 is ",type(data2))
|
||||||
|
|
||||||
|
result = data1 / data2
|
||||||
|
print("Result is ",type(result))
|
||||||
|
|
||||||
|
print("The quotient is ",result)
|
||||||
|
|
||||||
|
print(f"The quotient is {result}")
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
data1 = input("Enter a value for data1: ")
|
||||||
|
data1 = float(data1)
|
||||||
|
|
||||||
|
data2 = input("Enter a value for data2: ")
|
||||||
|
data2 = float(data2)
|
||||||
|
|
||||||
|
print("Data1 is ",type(data1))
|
||||||
|
print("Data2 is ",type(data2))
|
||||||
|
|
||||||
|
result = data1 * data2
|
||||||
|
print("Result is ",type(result))
|
||||||
|
|
||||||
|
print("The product is ",result)
|
||||||
|
|
||||||
|
print(f"The product is {result}")
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
data1 = input("Enter a value for data1: ")
|
||||||
|
data1 = float(data1)
|
||||||
|
|
||||||
|
data2 = input("Enter a value for data2: ")
|
||||||
|
data2 = float(data2)
|
||||||
|
|
||||||
|
print("Data1 is ",type(data1))
|
||||||
|
print("Data2 is ",type(data2))
|
||||||
|
|
||||||
|
result = data1 - data2
|
||||||
|
print("Result is ",type(result))
|
||||||
|
|
||||||
|
print("The difference is ",result)
|
||||||
|
|
||||||
|
print(f"The difference is {result}")
|
||||||
|
|
Loading…
Reference in New Issue