如果输入4,6.8,1,9.7,-2,则下列程序的输出结果是()
number=eval(input())
max=number
whilenumber>0:
number=eval(input())
ifnumber>max:
max=number
print(max)
number=eval(input())
max=number
whilenumber>0:
number=eval(input())
ifnumber>max:
max=number
print(max)
举一反三
- 如果输入4,6.8,1,9.7,-2,则下列程序的输出结果是()number ...= numberprint (max)
- 如果输入4,6.8,1,9.7,-2,则下列程序的输出结果是()number=eval
- 以下程序的输出结果是___________。 number = 10 if number % 2 == 0: print(number, 'is even') elif number % 5 == 0: print(number, 'is multiple of 2')
- 在HTML5表单中声明一个数值输入类型,要求控制用户填写的数值在0-100之间,并且只能是5的整数倍。以下哪种写法正确?( )。 A: <;input type=”number” max=”0” min=”100” step=”5” />; B: <;input type=”digit” max=”0” min=”100” step=”5” />; C: <;input type=”number” min=”0” max=”100” step=”5” />; D: <;input type=”digit” min=”0” max=”100” step=”5” />;
- 假设 number 的输入是9。以下程序将显示什么?number = eval(input("Enter an integer: ")) isPrime = True for i in range(2, number): if number % i == 0: isPrime = False print("i is", i) if isPrime: print(number, "is prime") break else: print(number, "is not prime") A: i is 3 9 is prime B: i is 3 9 is not prime C: i is 2 9 is prime D: i is 2 9 is not prime