-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.py
More file actions
34 lines (24 loc) · 702 Bytes
/
Basic.py
File metadata and controls
34 lines (24 loc) · 702 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
if 5 > 2:
print("5 is greater then 2")
if 5 > 2:
print("5 is greater then 2")
# Variable declaration
a = 5 # a is of type int
y = "Hello, world!" # y is of type str
# Casting -> If you want to specify the data type of a variable, this can be done with casting
x = str(3) # x will be '3'
y = int(3) # y will be 3
z = float(3) # z will be 3.0
print(a)
print(y)
# type() -> You can get the data type of a variable with the type() function.
print(type(x))
print(type(y))
print(type(z))
q = "Rishi" # Double-Quote
Q = 'Rishi' # single-Quote
# Also Pythom variables are case Sensitive, Mena one cannot overcome 'q' with 'Q'
# This is a comment
"""
This is a Multiline comment
"""