Essential Built-in Methods for Strings and Lists in Programming
Built-in Methods for Numeric Types (int and float)
The int() and float() functions are used for type creation and conversion.
# Type definition
age = 10 # Equivalent to age = int(10)
salary = 3000.3 # Equivalent to salary = float(3000.3)
# Type conversion
s = '123'
res = int(s) # Converts string of integers to int
print(res, type(res)) # O ...
Posted on Sat, 25 Jul 2026 16:46:40 +0000 by simwiz