Write an expression that will print "dollar or more" if the value of numcents is at least a dollar (100 cents is a dollar). ex: if numcents is 109, output is "dollar or more".

Respuesta :

Im not sure what you mean by that?

Answer:

num_cents = 109

if (num_cents >= 100):

   print('Dollar or more')

else:

   print('not a dollar')

Explanation:

simple solution/explanation

100 cents equals to 1 dollar, if there are 100 cents or more

print Dollars or more

Otherwise print not a dollar if there's less than 100 cents.

In this case we have 109 cents which is 1 dollar and 9 cents.

You could add an extra else if statement if more conditions are needed for different amounts; however the code above will make sure you pass the 'test' if you are learning this through zybooks.