如何从头开始代码再检查用户输入:
这里用户可以选择负值和正值,但不能选择0
和1
如果用户写入0
或1
,我应该怎么做才能再次启动另一个输入的代码
inp = float(input("PLEASE ENTER VALUE: "))
for xx in range(1,820):
A = dfimppara.iloc[xx, 1]
B = dfimppara.iloc[xx, 2]
lim = Ju - Jl
if inp<0:
if lim > 1:
pass
else:
print('You are calculating the entire possible J')
print('ans=',A,'-->', B,'Tex =', ET(xx))
if inp==0 or inp==1:
#I want the code to start at beginning to use another inp
else:
if Ju==inp:
print('ans=',A,'-->', B,'Tex =', ET(xx))
使用while循环:
相关问题 更多 >
编程相关推荐