Lecture for 10/20/2022
This commit is contained in:
parent
e4cfe759e6
commit
9f2a91d67d
12 changed files with 423 additions and 0 deletions
53
lecture20261020/floats02.py
Normal file
53
lecture20261020/floats02.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
data1 = 6.
|
||||
data2 = 4
|
||||
|
||||
|
||||
print("-------------Float addition")
|
||||
|
||||
result = data1 + data2
|
||||
|
||||
print("The value of data1 is ",data1)
|
||||
print("The value of data2 is ",data2)
|
||||
print("The value of result is ",result)
|
||||
|
||||
print("The type of data1 is ",type(data1) )
|
||||
print("The type of data2 is ",type(data2) )
|
||||
print("The type of result is ",type(result) )
|
||||
|
||||
print("-------------Float subtraction")
|
||||
|
||||
result = data1 - data2
|
||||
|
||||
print("The value of data1 is ",data1)
|
||||
print("The value of data2 is ",data2)
|
||||
print("The value of result is ",result)
|
||||
|
||||
print("The type of data1 is ",type(data1) )
|
||||
print("The type of data2 is ",type(data2) )
|
||||
print("The type of result is ",type(result) )
|
||||
|
||||
print("-------------Float multiplication")
|
||||
|
||||
result = data1 * data2
|
||||
|
||||
print("The value of data1 is ",data1)
|
||||
print("The value of data2 is ",data2)
|
||||
print("The value of result is ",result)
|
||||
|
||||
print("The type of data1 is ",type(data1) )
|
||||
print("The type of data2 is ",type(data2) )
|
||||
print("The type of result is ",type(result) )
|
||||
|
||||
print("-------------Float division")
|
||||
|
||||
result = data1 / data2
|
||||
|
||||
print("The value of data1 is ",data1)
|
||||
print("The value of data2 is ",data2)
|
||||
print("The value of result is ",result)
|
||||
|
||||
print("The type of data1 is ",type(data1) )
|
||||
print("The type of data2 is ",type(data2) )
|
||||
print("The type of result is ",type(result) )
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue