i need help with python Write an expression that will print

i need help with python: Write an expression that will print \"Dollar or more\" if the value of num_cents is at least a dollar (100 cents is a dollar). Ex: If num_cents is 109, output is \"Dollar or more\".

Solution

Answer:

>>> num_cents=109;

>>> print(\"Dollar or more\") if(num_cents-100 <=10 and num_cents-100 >=-10) else print(\"not a Dollar or more\");
Dollar or more


>>> num_cents=50;
>>> print(\"Dollar or more\") if(num_cents-100 <=10 and num_cents-100 >=-10) else print(\"not a Dollar or more\");
not a Dollar or more
>>>

i need help with python: Write an expression that will print \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site