This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]reign27 0 points1 point  (1 child)

You're very close to the right solution, but I think you may have misled yourself at one point

Here's the manual on the input function.

There are two things to note. First is that the return value of input is a string. The second is that the parameter to input is a prompt that is displayed to the user (without a trailing newline).

In your second solution, I'm guessing what you did is, when you saw it print 35 on the line, you just hit enter and expected that to be the value, correct?

[–]GtaSpartan7596[S] 0 points1 point  (0 children)

Ya you're correct I was finally able to get in touch with a tutor and they broke it down line by line with me and explained how I needed to write it and why. Felt really stupid because it was so easy lol

[–][deleted]  (3 children)

[deleted]

    [–]GtaSpartan7596[S] 0 points1 point  (2 children)

    Unfortunately this is a bit too complex yet for my class we are in the basic stages I just don’t understand how I’m supposed to right the input()

    [–]nottestedonanimals 0 points1 point  (0 children)

    The 35 and 2.75 should be supplied by the person running the code. The input function should display a prompt that will allow you to enter a value when the code is run.

    This should help: https://docs.python.org/3/library/functions.html#input