Beginning Python Programming
Makzan, 2020 April.
age = input("What is your age? ") age = int(age) print(type(age)) # Result: > What is your age? 32 > <class 'int'>
L = [1,2,3,3,3,4,5] S = set(L) print(S) print(list(S)) # Result: > {1, 2, 3, 4, 5} > [1, 2, 3, 4, 5]
# Convert to int int('123') int(123.0) # Convert to float float('123.4') float(123) # Convert to string str(123) # Convert to list list({1,2,3,4}) # Convert to set set([1,2,3,3,3])
By makzan