How To Learn The Split

[Solved] How To Learn The Split | Perl - Code Explorer | yomemimo.com
Question : how to use a split

Answered by : happy-heron-w399fhsok21u

>>> 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
>>>

Source : https://stackoverflow.com/questions/19098478/python-valueerror-too-many-values-to-unpack | Last Update : Tue, 27 Jul 21

Answers related to how to learn the split

Code Explorer Popular Question For Perl