Input function use in Project for Control Flow

Hi there! I am trying to get my head around an issue and hope you guys can help –

See screenshot below – I cannot understand why I keep getting an EOF message when typing in the input function on line 23. The syntax seems fine to me, brackets closed, and variable assignment valid – or am I missing something?

there is no more input to read. this is equivalent to calling someone (phone) and they hang up

I suggest writing the value in the code instead, or running it on your own computer or some other environment for example

Thanks for your help – not sure I understand!
Let me think aloud: in my understanding, the only input the code was supposed to read still has to be given by the user, as per the function I wrote. So it feels weird to me it first prints, and then gives me the EOF, which usually pops up when brackets or quotes aren’t closed. Would you be able to write down the correct formulae so I can have a look? No worries about the exercise, I had completed and was just experimenting with other stuff :slight_smile:


You’re reading input.
There is no input.

Do you mean I have to structure the code in a way that allows the program to first get the input from the user and then run the rest of the code?

No, I mean that no input is offered to your program. You’re trying to measure something that isn’t there. There is no input. Trying to read it will give you an error message.

This is why you’d need to run that in a different environment, one where you do provide input to your program.

Alright things are clearing up – so essentially the way I wrote the code is correct but the environment doesn’t support in this specific instance input from the user? Sorry to keep throwing questions, this is being so helpful though!

1 Like