Python Forum
im not sure what ive done wrong code doesnt run
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
im not sure what ive done wrong code doesnt run
#2
It doesn't run because you have a try without a matching except

There are a few issues with your code for starters:
again is assigned as 'y' and never re-assigned so the first while loop will always be True.
The second while loop is not required.
key is repeatedly assigned on every while loop iteration and is never used.
A file is opened and never closed
ans is not defined
Reply


Messages In This Thread
RE: im not sure what ive done wrong code doesnt run - by Yoriz - Nov-12-2022, 11:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  what is wrong with my code 53535 4 1,632 Apr-07-2022, 11:37 AM
Last Post: 53535
  What's wrong with my code? NeedHelpPython 4 2,298 Oct-22-2021, 07:59 PM
Last Post: Yoriz
  Help with my code due 11:59 pm, can you tell me where I went wrong and help fix it? shirleylam852 1 2,733 Dec-09-2020, 06:37 AM
Last Post: stranac
  I am getting an incorrect average, and not sure why? What's wrong with my code? shirleylam852 8 4,810 Nov-20-2020, 05:32 AM
Last Post: deanhystad
  Something is Wrong with my code susmith552 4 3,092 Nov-28-2019, 02:16 AM
Last Post: susmith552
  What is wrong with my code? Than999 1 2,414 Nov-10-2019, 08:59 PM
Last Post: ichabod801
  It worked now it doesnt...ugh raymond2688 15 5,630 Aug-07-2019, 07:47 PM
Last Post: raymond2688
  A program for backing up documents (doesnt work(code is inside)) Richard_SS 4 3,484 Jun-05-2019, 03:47 PM
Last Post: heiner55
  Wrong output on my code. JTNA 2 7,985 Apr-04-2019, 01:55 PM
Last Post: JTNA
  Why is this code wrong? Lemmy 4 5,241 Apr-05-2018, 03:46 PM
Last Post: Lemmy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020