Answers for "splitting an int python"

1

split a given number in python

# split a given int value in list
num = 13579
x = [int(a) for a in str(num)]
print(x)
Posted by: Guest on October-15-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