How to remove unwanted single quotes

后端 未结 2 674
甜味超标
甜味超标 2021-01-24 13:19

I\'m new to programming and I stumbled across something unsightly that I would like to remove. Here\'s my code:

def test1():
    print \"What is your name, trave         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 13:41

    Or use the "new" string formatting method:

    def test1():
    print "What is your name, traveler?"
    name = raw_input()
    print "Hi {0}!".format(name)
    

提交回复
热议问题