Answers for "how to use a split"

0

how to use a split

>>> score1,score2 = input("Enter two scores separated by a comma:").split(",")
Enter two scores separated by a comma:1,2
>>> score1
'1'
>>> score1 = int(score1)
>>> score1
1
>>> score1 = float(score1)
>>> score1
1.0
>>>
Posted by: Guest on July-20-2021

Browse Popular Code Answers by Language