Extra spaces when printing

后端 未结 4 1155
梦毁少年i
梦毁少年i 2021-01-28 06:05

I\'ve read through a number of the python whitespace removal questions and answers but haven\'t been able to find what I\'m looking for. Here is a small program that shows a sp

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 06:39

    print ("\n\n\nOn the math section, you guessed",math_guess,", and your actual score was",math_score,"!", sep ='')
    

    if this is py3+ i think

    print ("\n\n\nOn the math section, you guessed"+str(math_guess)+", and your actual score was"+str(math_score)+"!")
    

    should work if not

    or use string formatting as others have suggested...

提交回复
热议问题