📜  如何使用拆分 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:55.143000             🧑  作者: Mango

代码示例1
>>> 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
>>>