Python Matplotlib:TypeError:float()参数必须是字符串或数字,而不是';非类型';

Python Matplotlib:TypeError:float()参数必须是字符串或数字,而不是';非类型';,python,python-3.x,shell,matplotlib,typeerror,Python,Python 3.x,Shell,Matplotlib,Typeerror,打印('--------------条形图-------------------------------') 这是我的代码,我得到了错误类型错误:float()参数必须是字符串或数字,而不是'NoneType',我该怎么办?我看不到任何问题。我运行代码,它对我很有效。可能在输入错误的情况下,它工作不正确。但这是因为输入错误)请在问题中包含完整的回溯,而不仅仅是错误消息。 x=[] y=[] amount=int(input("Amount of bars:")) fina=a

打印('--------------条形图-------------------------------')


这是我的代码,我得到了错误类型错误:float()参数必须是字符串或数字,而不是'NoneType',我该怎么办?

我看不到任何问题。我运行代码,它对我很有效。可能在输入错误的情况下,它工作不正确。但这是因为输入错误)请在问题中包含完整的回溯,而不仅仅是错误消息。
x=[]
y=[]
amount=int(input("Amount of bars:"))
fina=amount+1
for item in range(1,fina):
    barlabel=input("Enter bar label:")
    x.append(barlabel)
    barvalue=int(input("Enter bar value:"))
    y.append(barvalue)
xlabe=input("X Lable:")
ylabe=input("Y Lable:")
titlee=input('Graph title:')
space=float(input('Enter spacing between bars(spacing is from 0 to 1):'))
print('''
\nWhen asked to choose a color you will have to choose from the available colors:
\n\tb=blue\n\tg=green\n\tr=red\n\tc=cyan\n\tm=magenta\n\ty=yellow\n\tk=black\n\tw=white
''')
grida=input("Color of grid:")
back=input("Background color:")
bar=input("Bar color:")
blue="b"
green='g'
red='r'
cyan='c'
magenta='m'
yellow='y'
black='b'
white='w'
ax=plt.axes()
ax.set_facecolor(back)
plt.xlabel(xlabe)
plt.ylabel(ylabe)
plt.title(titlee)
plt.hist(y,rwidth=space)
plt.grid(color=grida)
plt.bar(x,y,bar)
plt.show()