令Num1=1且Num2=2,则下列表达式为真还是为假。(Num1==1) OR (Num2==2) AND (Num1==Num2)
举一反三
- int num1=12, num2=9; num1 =num1 & num2;执行后num的值为8。( )
- 假设存在变量$str1="abc";$str2="ABC";$numl=23;$num2=45,下面哪一组表达式的运算结果是假值?( ) A: $str1<;$str2&&$num1 <;$num2 B: $str1>;$str2&&$num1 <;$num2 C: $str1<;$str2}}$num 1 <;$num2 D: $str 1 >;$str2||$num1 >;$num2
- 在代码后面说明变量是全局变量还是局部变量num1=1 #num1为__________(1)num2=2 #num2为__________(2)def fun(): global num1 #num1为__________(3) num1 =11 num2 = 22 #num2为__________(4) print(num1,num2)fun()print(num1,num2)
- 编写一个函数判断客户输入一个数字为1位、2位还是更多为,代码如下:请补全空下的代码num=int(input("输入一位或两位的数字:"))n='0'(1)n='1'(2)n='2'(3)d='>;2'print(n+"位数。”) A: 1: if num>;-10 and num<;10:2: eilf num >;-100 and num<;100:3: else: B: 1: if num>;10 and num<;-10:2: eilf num >;-100 and num<;100:3: else: C: 1: if num>;-10 and num<;10:2: eilf num <;-100 and num>;100:3: elif: D: 1: if num>;-100 and num<;100:2: eilf num >;-10 and num<;10:3: else:
- 中国大学MOOC: 执行如下代码片段后,num的值为:int num = 5;num = (num % 2) == 0 ? num – 1 : num + 1;