Bill H. answered 05/17/18
Tutor
4.9
(1,373)
Over 20 years of Python programming and 4000 hours of tutoring.
Yes:
x=3 if a=='yes' else 7
This assigns 3 or 7 to x depending on the value of a.
Curt B.
asked 05/16/18Bill H. answered 05/17/18
Over 20 years of Python programming and 4000 hours of tutoring.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.