Suppose that I get the values for valid, d ,sn from a function that I introduced in my program. Then I pass it through the following if statement in python to output the result.
I want the program to print the following statements:
- print
onif thesn >= 0and1<d <90. - print
off-rightif thesn<0. - print
off-leftif thed>=90 - other than that, for anything that is not valid outputs
unknown.
Here is what I wrote, how do I include d when checking the statement?
if valid: if sn >= 0 and 1<d <90: print(" on ") else: print("off") else: print("unknown")
Aucun commentaire:
Enregistrer un commentaire