# Casting = Specify a type on to a variable.
# Strings
x = str("s1") # x will be 's1'
y = str(2) # y will be '2'
z = str(3.0) # z will be '3.0'
# Ints
x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3
# Floats
x = float(1) # x will be 1.0
print(str(1)) # convert number to string
print(int("1")) # convert string to int
print(float(1)) # convert int to float
print(list('hello')) # convert string to list
print(tuple('hello')) # convert string to tuple
print(list((1, 2, 3))) # convert tuple to list
print(tuple([1, 2, 3])) # convert list to tuple
print(bool(1)) # convert a number to boolean
print(bool(0)) # convert a number to boolean
print(bool("")) # convert a string to boolean
print(bool("data")) # convert string to boolean
print(bin(10)) # convert an integer to a binary string
print(hex(10)) # convert an integer to a hex string
print(oct(10)) # convert an integer to an octal string
x = "3"
int(x)
y = "2.6"
float(y)
z = "1j"
complex(z)
print(typeof(x))
# Int
# float
# complex
x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3
x = float(1) # x will be 1.0
y = float(2.8) # y will be 2.8
z = float("3") # z will be 3.0
w = float("4.2") # w will be 4.2
x = str("s1") # x will be 's1'
y = str(2) # y will be '2'
z = str(3.0) # z will be '3.0'
var_as_num = 10
var_as_str = str(var_as_num)
x = int(1.1)
y = str(1.1)
z = float(1.1)
print(x)
print(y)
print(z)
x = str("Jack");
y = int(111)
print(x)
print(y)