我想要的是在 python 语言的编码考试中口头解释用于读取或使用标准输入给出的输入的代码
what i want is verbal explaination of the code for read or use inputs given by stdin in coding exam in python language
如何读取或使用标准输入给出的输入。例如,有 n 个高度不同的杆。从这 n 个极点,我必须使用任何 4 poles.I 来确定是否会形成一个正方形,并提供 2 个线串的输入。第一行给出了极数,第二行给出了极的高度。像下面
输入
8
2 4 3 2 2 4 2 2
输出
是
解释:有4根柱子高度相同,所以可以拼出正方形。
如果我必须定义将 1 个参数作为输入的函数。应该如何使用这个参数
例如。
def Determinesquare(参数):
python.
中的操作方法如下
no_of_poles=int(input())
#store all the heights into a list for easy access
heights=list(map(int,input().split()))
然后继续解决问题。
如何读取或使用标准输入给出的输入。例如,有 n 个高度不同的杆。从这 n 个极点,我必须使用任何 4 poles.I 来确定是否会形成一个正方形,并提供 2 个线串的输入。第一行给出了极数,第二行给出了极的高度。像下面 输入
8
2 4 3 2 2 4 2 2
输出
是
解释:有4根柱子高度相同,所以可以拼出正方形。
如果我必须定义将 1 个参数作为输入的函数。应该如何使用这个参数 例如。 def Determinesquare(参数):
python.
中的操作方法如下no_of_poles=int(input())
#store all the heights into a list for easy access
heights=list(map(int,input().split()))
然后继续解决问题。