我的输出屏幕上显示“无”打印。 我正在尝试仅打印数字值(“无”除外)。
在将其发布到StackOverflow之前,我尝试了一些建议的解决方案。
import numpy as np
a = np.matrix('1,2; 3,2; 3,2')
b = a.copy()
def unit(): # Funtion 1
if(num[2]!=1):
if(num[3]==1):
print("-One")
elif(num[3]==2):
print("-Two")
elif(num[3]==3):
print("-Three")
elif(num[3]==4):
print("-Four")
elif(num[3]==5):
print("-Five")
elif(num[3]==6):
print("-Six")
elif(num[3]==7):
print("-Seven")
elif(num[3]==8):
print("-Eight")
elif(num[3]==9):
print("-Nine")
elif(num[3]==0):
print("")
def tens(): # Function 2
if(num[2]==1):
if(num[2]==1):
print("-Eleven")
elif(num[2]==2):
print("-Twelve")
elif(num[2]==3):
print("-Thirteen")
elif(num[2]==4):
print("-Fourteen")
elif(num[2]==5):
print("-Fiveteen")
elif(num[2]==6):
print("-Sixteen")
elif(num[2]==7):
print("-Seventeen")
elif(num[2]==8):
print("-Eighteen")
elif(num[2]==9):
print("-Nineteen")
elif(num[2]==0):
print("")
elif(num[2]==2):
print("-Twenty")
elif(num[2]==3):
print("-Thirty")
elif(num[2]==4):
print("-Forty")
elif(num[2]==5):
print("-Fifty")
elif(num[2]==6):
print("-Sixty")
elif(num[2]==7):
print("-Seventy")
elif(num[2]==8):
print("-Eighty")
elif(num[2]==9):
print("-Ninety")
elif(num[2]==0):
print("")
def hundred(): #Function 3
if(num[1]==1):
print("-One Hundred")
elif(num[1]==2):
print("-Two Hundred")
elif(num[1]==3):
print("-Three Hundred")
elif(num[1]==4):
print("-four Hundred")
elif(num[1]==5):
print("-five Hundred")
elif(num[1]==6):
print("-Six Hundred")
elif(num[1]==7):
print("-Seven Hundred")
elif(num[1]==8):
print("-Eight Hundred")
elif(num[1]==9):
print("-Nine Hundred")
elif(num[1]==0):
print("")
def thou(): #function 4
if(num[0]==1):
print("-One thousand")
elif(num[0]==2):
print("-Two Thousand")
elif(num[0]==3):
print("-Three Thousand")
elif(num[0]==4):
print("-Four Thousand")
elif(num[0]==5):
print("-Five Thousand")
elif(num[0]==6):
print("-Six Thousand")
elif(num[0]==7):
print("-Seven Thousand")
elif(num[0]==8):
print("-Eight Thousand")
elif(num[0] == 9):
print("-Nine Thousand")
elif(num[0]==0):
print("")
预期输出应为其受尊重的值。例如,如果输入1234,则输出应为123。
,但它也包含此--->“ None None None None”。为什么会这样?