Answers for "split into ints python"

2

python how to split a number

number = "12345"
result = []
for digit in number:
    result.append(digit)
print(result)
# result is ['1', '2', '3', '4', '5']
Posted by: Guest on October-24-2021
1

split string and convert to int python

a, b = tuple(int(x) for x in '1 2'.split())
Posted by: Guest on October-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language