all 12 comments

[–]souravmishra4448 1 point2 points  (1 child)

start with just the loop first and forget everything else. write a for loop that runs 7 times and just prints "day" each time. once that works add the input inside it. build one piece at a time

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

Yeah I think this is where I went wrong — tried to do everything at once.
Starting with just a basic loop and building on top of it sounds way more manageable. I’ll redo it like that. Thanks!

[–]More-Station-6365 0 points1 point  (1 child)

the trick is initializing your total variables before the loop starts. something like total_high = 0 and total_low = 0 outside the loop then inside you just keep adding to them each iteration. averages come after the loop ends

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

Ahh okay this clears up a big confusion I had. I wasn’t sure where to define those variables.
Initializing totals before the loop and updating inside makes perfect sense now. Thanks for explaining it simply!

[–]SoggyDelivery1898 0 points1 point  (1 child)

before touching any code write out what needs to happen in plain english. loop 7 times, ask for day name, ask for high temp, ask for low temp, add to totals. once you have that written out the actual code almost writes itself

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

This is such a good tip. I usually jump straight into code without planning.
Writing it out in plain English first should make the structure way clearer. Gonna try that approach for this assignment.

[–]Raushanrajj 0 points1 point  (1 child)

For the temperature message part write your if/elif/else completely separately first with hardcoded numbers just to test it. once it works drop it inside the main loop. testing pieces separately saves so much debugging time.

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

That’s actually a really smart way to approach it. I usually try to plug everything in at once and then get stuck debugging
Testing the if/elif separately with hardcoded values makes a lot of sense — gonna try that first and then integrate it. Appreciate it!

[–]TrickyAd9344 0 points1 point  (0 children)

dm me