-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex3.py
32 lines (26 loc) · 948 Bytes
/
ex3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
print("I'll count my livestock:")
print("Chicken", 25 + 30 / 6)
print("Roosters", 100 - 25 * 3 % 4)
print("And now I'll count all eggs:")
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true, that 3 + 2 < 5 - 7?")
print(3 + 2 < 5 -7)
print("What is 3 + 2?", 3 + 2)
print("What is 5 -7?", 5 -7)
print("Oops, I seem to be confused...Why False")
print("I'll count again")
print("Is it bigger?", 5 > -2)
print("Is greater then or equal to?", 5 >= -2)
print("Is less then or equal to?",5 <= -2)
# lynks >> https://www.geeksforgeeks.org/python-numbers-type-conversion-and-mathematics/
# Python code to demonstrate Type conversion
var1 = 3.14
# type conversion of float to int .
var2 = int(var1)
print ("After converting float to integer : ", var2)
print ("type : ",type(var2))
# type conversion of string to integer
var3 = "323"
var4 = int(var3)
print ("After converting string to integer : ", var4)
print ("type : ",type(var4))