2
def hourstominutes(minutes):

    hours = minutes/60
    return hours


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

print(hourstominutes(h))
Vitaliy Terziev
  • 5,818
  • 3
  • 16
  • 24

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
  • 14,458
  • 5
  • 18
  • 47
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,219
  • 8
  • 14