-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathVariable_c1.py
48 lines (36 loc) · 835 Bytes
/
Variable_c1.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from tkinter import DoubleVar
from tokenize import Double
x = 5 # this is int type value
y= "Rishabh" # this is string type value
z = 5.4 # this float type value
print("INT value - ", x)
print ("String value - ", y)
print ( "Float value - ",z)
#Expilict type casting the data types
x = float(5) #float type data - 5.0
y=int(2) #int type data - 2
z = str("yadav")#str type data - yadav
print("INT value - ", y)
print ("String value - ", z)
print ( "Float value - ",x)
"""
Get the Type
You can get the data type of a variable with the type() function.
"""
x = 4
y= "str"
# is same as
z='str'
print(type(x))
print(type(y))
print(z)
print (type(z))
"""
Case-Sensitive
Variable names are case-sensitive.
"""
A = 'rishabh yadav'
a = 'rakesh singh'
# a doesn't overwrite A means a and A both are different
print(A)
print(a)