s=b"\x41\x42" s=s+b"\x43" print(s) 结果类型是:
举一反三
- 对若干个正数求和,输入“ok”结束,下面正确的代码是( )。知识点:while循环。 A: s = 0x = input()while x!="ok": s += int(x) print(s) B: s = 0while True: x = input() if x=="ok": break s += int(x) print(s) C: s = 0x = input()while x!="ok": s += int(x) x = input()print(s) D: s = 0while x!="ok": x = input() s += int(x) print(s)
- 对若干个正数求和,输入“ok”结束,下面正确的代码是( )。知识点:while循环。 A: s = 0x = input()while x!="ok": s += int(x) print(s) B: s = 0while True: x = input() if x=="ok": break s += int(x) print(s) C: s = 0x = input()while x!="ok": s += int(x) x = input()print(s) D: s = 0while x!="ok": x = input() s += int(x) print(s)
- 写出下列程序段的输出结果(栈的元素类型为char)。 void main(){ Stack S; char x,y; InitStack(S); x= ‘c’; y= ‘k’; Push(S,x); Push(S, ‘a’); Push(S,y); Pop(S,x); Push(S, ‘t’); Push(S,x); Pop(S,x); Push(S, ‘s’); while(!StackEmpty(S)) { Pop(S,y); printf(y); } printf(x); }
- 所有北大学生(S(x))都是聪明的(P(x))”谓词公式是 A: $x(S(x)∧P(x)) B: "x(S(x)→P(x)) C: $x(S(x)∧﹁P(x)) D: "x(S(x)→﹁P(x))
- 以下程序的执行结果为: def square(x,y=2): s=x**y return s print(square(3,4))