black

计算机考试试题及答案解析

登录

填空题

下列程序运行后,在键盘输入"apple and peach",则程序运行结果是()。
str=input("请输入一串字符串:")
flag=0
count=0
for c in str:
if c=="":
flag=0
else:
if flag==0:
flag=1
count=count+1
print(count)

【参考答案】

1

相关考题

填空题 Python语句"f=lambda x,y;x*y;f(12,34)"的程序运行结果是()。

单项选择题 Python 语句"f1=lambda x:x*3;f2=lambda x:x*2;print(f1(f2(3)))"的程序运行结果是()。

单项选择题 下列Python语句的输出结果是()。counter=0;num=0def TestVariable():global counterfor i in range(4):counter+=1num=5TestVariable()print(counter,num)

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3