dimanche 31 octobre 2021

How do I associate strings with if conditions in python

  1. var1 = str(input('Choose either A or B'))
  2. var2 = 'A'
  3. if var1 == var2:
  4. print('Hello World') 
    
  5. else:
  6. print('Try something else') 
    

Aucun commentaire:

Enregistrer un commentaire