-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTypecasting-3.py
More file actions
34 lines (24 loc) · 828 Bytes
/
Copy pathTypecasting-3.py
File metadata and controls
34 lines (24 loc) · 828 Bytes
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
#***************{" TYPE CAST THE Complex TYPE"}********
# _______________|________________
# | |
# ("FORM -1 ") (" form-2")
# Comlplex(x) Complex(x.y)
#>>>> It's convert{x} into complex || >>> We can use this method to convert (x)
#>>>> number with real part and || >>> and (y) into complex number such that (x)
#>>>>imaginary part (0). || >>> will be real part and (y) will be IMAGINARY PART.
a=complex(10)
print(a) #(10+0j)
b=complex(True)
print(b) #(1+0j)
c=complex(False)
print(c) #0j
d=complex("10")
print(d) #(10+0j)
e=complex("10.5")
print(e) #(10.5+0j)
# r=complex("ten")
# print(r) #ValueError: complex() arg is a malformed string
w=complex(10,-2)
print(w)
q=complex(True,False)
print(q)