热线电话:13121318867

登录
2019-03-19 阅读量: 470
在Python 3.x中如何不使用换行符进行打印?

在Python 3.x中不使用换行符进行打印

# Python 3 code for printing

# on the same line printing

# geeks and geeksforgeeks

# in the same line

print("geeks", end =" ")

print("geeksforgeeks")

# array

a = [1, 2, 3, 4]

# printing a element in same

# line

for i in range(4):

print(a[i], end =" ")

输出:

geeks geeksforgeeks
1 2 3 4
0.0000
3
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子