小编Bob*_*nov的帖子

为什么我的所有变量都得到None值?

所以,我试图制作一个简单的Base 10到Base 16转换器(我意识到这是Base 10整数到mock-Base 16字符串).我是Python的新手; 我本周刚开始学习它(我之前有C#的编程经验,所以我不会对此感到迷茫).

R1 = 0
R2 = 0
R3 = 0
R4 = 0
R5 = 0

number = int(raw_input("Enter a base 10 number (Smaller than 1048576): "))

def numberConvert(a=0):
  a = str(a)

  if (a == "10"):
    a = "a"
  elif (a == "11"):
    a = "b"
  elif (a == "12"):
    a = "c"
  elif (a == "13"):
    a = "d"
  elif (a == "14"):
    a = "e"
  elif (a == "15"):
    a = "f"
  else: …
Run Code Online (Sandbox Code Playgroud)

python variables arguments function nonetype

1
推荐指数
1
解决办法
81
查看次数

标签 统计

arguments ×1

function ×1

nonetype ×1

python ×1

variables ×1