Python For Beginner_PG_Day2.ipynb - Colab
Python For Beginner_PG_Day2.ipynb - Colab
data types are used to define the type of value that a vaiable hold or store
name = "John"
print(type(name))
<class 'str'>
x = 100
print(type(x))
<class 'int'>
marks = 3.33
print(type(marks))
<class 'float'>
is_raining = True
print(type(is_raining))
<class 'bool'>
Someting
type casting or type converter is a process to covert one data type into another
x = 100
y = "200"
print(str(x) + y)
print(x + int(y))
new_x = str(x)
new_y = int(y)
new_total = new_x + y
new_total1 = x + new_y
print(new_total)
print(new_total1)
100200
300
100200
300
print()
print()