-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperators.py
More file actions
51 lines (21 loc) · 765 Bytes
/
operators.py
File metadata and controls
51 lines (21 loc) · 765 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#operators in python
#objects are the core things in python.
#there are 2 kinds of objects :- Scalar and Non Scalar.
#Scalar objects are indivisble whila Non Scalar has their own internal structure.
#Python has 4 main types of scalar objects.
# int -----can be written like -3, 4 200045.
print(4)
#output ---4
print(-3)
#output --> -3
# float is used for real numbers. we can also represent float using scientific notation.
print(2e4)
#output ---> 20000.0
# Boolean is used to boolean values true and false.
# we can find the type of any object using the "type" keyword.
type(3)
#output -- <class 'int'>
type(3.0)
#output -- <class 'float'>
type("python")
#output -- <class 'str'>