mardi 27 février 2018

How to have multiple statement for every condition in an if function in python

I am writing a code in python 3.5.4 that requires more than one statement for every condition that I set in an if clause for example: enter code here a=10 b=20 c=30 n=int(input('please enter a number: ')) if n>0: print(d=a+b) print(e=a-b) print(f=a*b) else: print(0)

but if the first condition is met, only first statement is implemented. please tell me how to implement all 3 lines

Aucun commentaire:

Enregistrer un commentaire