【发布时间】:2020-03-08 22:34:18
【问题描述】:
print("Please enter integers (then press enter key twice to show you're done):")
s = input() #whatever you're inputting after the print
first = True #What does this mean???
while s != "": #What does this mean???
lst = s.split() #split all your inputs into a list
for x in lst:
if first: #If its in ur lst?
maxV = int(x) #then the max value will be that input as an integer
first = False #What does this mean?
else:
if maxV < int(x):
maxV = int(x)
s= input()
print(maxV)
我对这段代码中的 first=True 和 first=False 感到困惑,设置是什么意思 一个等于真或假的变量?也对 while s != "": 的含义感到困惑。对不起, 我是一个完整的初学者,如果有人可以帮助我,我将永远感激不尽
【问题讨论】:
-
这应该是什么语言?肯定不是Java,那你为什么把它标记为Java?
-
这些都是非常基本的问题,并且有一个地方可以回答这些问题:Python Tutorial
-
这看起来像 python,所以我冒昧地猜测你想知道带有布尔值的 if 语句的语法:stackoverflow.com/questions/38423360/…
标签: python