2024-03-28 23:48:31 发布
网友
我有一个存储输入值的列表。我想如果用户跳过这个问题,列表会得到nan值。你知道吗
我试过这个:
sex=[] sex.append(input("are you male or female?: ")) while not sex: sex.append(np.nan)
但不起作用。我得到这个结果: 性别=[“”,“”]
我怎么处理这个问题?你知道吗
你说“南”是什么意思?你知道吗
请尝试一下:
sexArr = [] sexInp = input(">Are you male or female?") if sexInp: sexArr.append(sexInp) print(sexArr)
你说“南”是什么意思?你知道吗
请尝试一下:
相关问题 更多 >
编程相关推荐