Type casting in Python is easy 💱

Описание к видео Type casting in Python is easy 💱

type casting = The process of converting a value of one data type to another
(string, integer, float, boolean)
Explicit vs Implicit

name = "Bro"
age = 21
gpa = 1.9
student = True

print(type(name))
print(type(age))
print(type(gpa))
print(type(student))

age = float(age)
print(age)

gpa = int(gpa)
print(gpa)

student = str(student)
print(student)

name = bool(name)
print(name)

00:00:00 what is type casting?
00:01:24 type function
00:02:23 explicit cast
00:06:17 implicit cast

#type #cast #casting

Комментарии

Информация по комментариям в разработке