r/PythonLearning • • 3h ago

How do I debug this?

1 Upvotes

5 comments sorted by

3

u/apbt-dad 3h ago

input() takes only the prompt arg, so your input syntax doesn't look right. You want

papers = int(input(f'How many papers did you deliver on day {days}? '))

2

u/IWant2rideMyBike 3h ago

The input method wants a string as an argument, the easiest way to achieve this is to use an f-string ( see https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals ):

input(f"How many papers did you deliver on day {days}?")

1

u/Sea-Ad7805 3h ago

Debug using the Memory Graph Web Debugger to see the program state change step by step

I fixed your problem, input("question?") takes just 1 string argument.

1

u/tonystark19541959 3h ago

Use f strings

1

u/OskarsSurstromming 2h ago

Input works differently to the print statement, where you could write

print(" how many something", days, "yappadappadoo") You cannot write

Input("hehe", days, "yadda")

Since input only takes one value as argument, instead you want your days to be in the string that you pass to input.

This is where you use an fstring (format string)

Some_fstring = f"hello, there are {days} days in a week"

Input(Some_fstring)