python怎样输出n行带标号的Hello world?
2个回答
2020-04-22
展开全部
honey@DESKTOP-H6QG9QG:~% cat mypy.py
lines=int(input())
for i in range(0,lines):
print("%d Hello world." %(i+1))
print("\n")
honey@DESKTOP-H6QG9QG:~% python3 mypy.py
5
1 Hello world.
2 Hello world.
3 Hello world.
4 Hello world.
5 Hello world.
lines=int(input())
for i in range(0,lines):
print("%d Hello world." %(i+1))
print("\n")
honey@DESKTOP-H6QG9QG:~% python3 mypy.py
5
1 Hello world.
2 Hello world.
3 Hello world.
4 Hello world.
5 Hello world.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询