我无法弄清楚如果该代码为false,如何使此代码不打印值

时间:2018-11-10 02:46:00

标签: python-3.7

qv2 = input("Is there a second variable? (Type 'yes' or 'no'): ").lower()   
# this is the control question
var2 = input("What is the second variable? ")
exp2 = int(eval(input("What is the second variables exponent? ")))
k = var2                                                                  
i = exp2
varexp1 = (("({}{})").format(k, i))
# and if they say no i dont want var2 or exp2 to print              
if qv2 == 'no':
    print("No second variable.")                                          

###我如何不打印var2和exp3?     其他:         打印(varexp1)

0 个答案:

没有答案