编程题1:
#Hello World的条件输出.py
import pdb
str=input()
num=eval(str)
hello="Hello World"
i=0
#pdb.set_trace()
if num==0:
print("Hello World")
elif num > 0:
while i<len(hello):
if i+2<=len(hello)-1:
print(hello[i:i+2])
else:
print(hello[-1])
i+=2
else:
while i<len(hello):
print(hello[i])
i+=1
编程题2:
tempStr=input()
num=eval(tempStr)
print("{:.2f}".format(num))