Going through the "Python Programming MOOC 2023" course from the University of Helsinki as someone completely new to coding. Need help with understanding my mess up.

[Python]

Howdy. Need some help here, as I'm not seeing where I'm going on. The exercise is as follows:

Please write a program which asks the user for a number. The program then prints out the number multiplied by five.

The program should function as follows:

(Sample output)

Please type in a number: 3

3 times 5 is 15

My code is as follows:

number = input("Please type in a number: ")
print(f"{number} times {5} is {number * 5}")

Once I input the number (I'm just using 3 as in the example output) the printed line is "3 times 5 is 33333". Not entirely sure where I messed up here. I've tried a few different things but can't figure this out.

Posted Sep 4, 2024, 7:25 PM UTC

11
Loading comments…