-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConversation.py
More file actions
55 lines (51 loc) · 1.31 KB
/
Conversation.py
File metadata and controls
55 lines (51 loc) · 1.31 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Implicit conversion
a = 2
b = 3.125
c = 1+3j
d = 35
print(a+b , type(a+b))
print(a+c , type(a+c))
print(a+d , type(a+d))
#Explicit Conversion
e = '14.254'
e = float(e)
print(e+d , type(e+d))
#Operators
#f += b
#print(f) #an error occurerd not defined
f = d*a #arthimetic oparators
g = a+c #arthimetic oparators
print(g) #arthimetic oparators
print(f)
h = f/d #arthimetic oparators
print(h, type(h))
i = g**h #arthimetic oparators
print(i, type(i))
j = f//h #arthimetic oparators
print(j, type(j))
print(a>b) #comparision operators
print(j==i) #comparison operator (false)
print(a==h) #compasion operator (true)
a += h #additional operator = a + h
print(a)
h -= a #subtractional operator = h - a
print(h, type(h))
print(a<b) #logical operator used to make decision (true or false output.)
g *= 3 #multiplication assignment operator = g * 3
f /= g #division assignment operator = f / g
print(g)
print(f , type(f)) # (3.888888888889 - 3.8888888889j) <class complex) answer to cell 37
k = 20000
l = '50'
l= int(l)
m = k / l
print(m, type(m)) # m = 400.0 <class float)
m = int(m)
n = m + l
print(n, type(n))
print(o, type(o))
print(p , type(p))
print(n)
print(min(50,100,120))
#o = input('name of the company') #adding input in a variable
#p = input('time of stay since employment')