Python 无效文字

Python 无效文字,python,list,dictionary,Python,List,Dictionary,我大约4-5周前才开始编写代码,现在遇到了一些问题。我正在尝试创建一个高分列表程序。当我尝试向列表中添加高分时,我得到错误“invalid literal for int(),以10为基数”,我将发布我的代码供您查看。所有的帮助都很棒。谢谢大家! scores = [("Roger", 1400), ("Justin", 2320), ("Beth", 3456)] print("Hello! Welcome to the high scores!:") print("\nHere are

我大约4-5周前才开始编写代码,现在遇到了一些问题。我正在尝试创建一个高分列表程序。当我尝试向列表中添加高分时,我得到错误“invalid literal for int(),以10为基数”,我将发布我的代码供您查看。所有的帮助都很棒。谢谢大家!

scores = [("Roger", 1400), ("Justin", 2320), ("Beth", 3456)]

print("Hello! Welcome to the high scores!:")

print("\nHere are the current high score leaders!")
print(scores)

print("\n0 - Sort high scores")
print("1 - Add high score")
print("2 - Reverse the order")
print("3 - Remove a score")

print("Please enter your selection")

option = int(input())

if option == 0:
    scores.sort()
    print("These are the scores sorted alphabetically")
    print(scores)


if option == 1:
    print("Please enter your name and score; For example: Joe, 22")
    name, score =( int(input()), int(input()) )
    entry = (name, score)
    scores.append(entry)
    print(scores)
这里,您得到2个输入,并尝试将它们转换为整数。但是,名称不是整数。所以,应该是这样

name,score = (raw_input(),int(input())

那是什么编程语言?请标记它。
name,score=(int(input()),int(input())
当您在那里输入像“Joe”这样的名称作为第一个输入时,Python将无法将其转换为int。只需获取原始输入而不进行int转换。我如何才能将其转换?我能去掉int代码吗@BilltheLizardI将其标记为@stephency原始输入函数未被python识别,并告诉我它未定义。我做错了什么@aswinmurugesh@JustinFarr只需使用
input()
作为名称,使用
int(input())
作为分数。
name,score = (raw_input(),int(input())