1
def hourstominutes(minutes):

    hours = minutes/60
    return hours


h = int(input(print("Enter the number of minutes:")))

print(hourstominutes(h))
Vitaliy Terziev
  • 6,429
  • 3
  • 17
  • 25

2 Answers2

4

Because you are adding the function print() within your input code, which is creating a None first, followed by the user input. Here is the solution:

def hours_to_minutes(minutes):
    hours = minutes/60
    return hours

h = int(input("Enter the number of minutes: "))
print(hours_to_minutes(h))

Output:

Enter the number of minutes: 50
0.8333333333333334
Celius Stingher
  • 17,835
  • 6
  • 23
  • 53
0

Input is printing the result of print("Enter the number of minutes:", and print() returns None. What you want is int(input("Enter the number of minutes:")) with no print().

Aaron Bentley
  • 1,332
  • 8
  • 14