How can i use raw_input and string formatting % or %d python

前端 未结 3 919
Happy的楠姐
Happy的楠姐 2021-01-26 11:26

i have variable var, and it is changeable how can i use raw_input and inside raw_input make a question and use this variable i.e.

z = raw_input(\"Is         


        
3条回答
  •  轮回少年
    2021-01-26 11:42

    I guess the cleanest way is to use format:

    z = raw_input("Is your age {0}?".format(var))
    

提交回复
热议问题