Can't figure out how to print horizontally in python?

前端 未结 3 2114
一向
一向 2020-12-07 04:23

I need to print this code:

for x in range (1, 21):  

    if x%15==0:
        print(\"fizzbuzz\")

    elif x%5==0:
        print(\"buzz\") 
    elif x%3==0:         


        
3条回答
  •  醉话见心
    2020-12-07 04:59

    A '\n' character is written at the end, unless the print statement ends with a comma.

    http://docs.python.org/2/reference/simple_stmts.html

提交回复
热议问题