Rachel M.

asked • 01/18/23

How can I get it to divide decimals without it crashing

The program works fine with whole numbers, as soon as I enter a decimal like 2.5 it crashes.

CLASS = str(input("What is the name of your class: "))

HOURS = int(input("How many hours a week do you spend in {}:".format(CLASS)))

number = HOURS*2

print("You should study for {}:" .format(number))

3 Answers By Expert Tutors


Joey L. answered • 01/22/23

New to Wyzant

Passionate Computer Science Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.