Even if the first command in if is true it doesn't print what i want , it only print the else command

前端 未结 4 1537
时光取名叫无心
时光取名叫无心 2021-01-24 14:22
numberchk=(int(input(\"Enter a Roman numeral or a Decimal numeral:\" )))
def int2roman(number):
    numerals={1:\"I\", 4:\"IV\", 5:\"V\", 9: \"IX\", 10:\"X\", 40:\"XL\",         


        
4条回答
  •  我在风中等你
    2021-01-24 14:49

    Try using isdigit() function.

    replace this part on your code

    if numberchk==int:
    

    with

    if numberchk.isdigit():
    

提交回复
热议问题