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
#1
def main():
    again='y'
    while again=='y' or again=='Y':
        try:
            key=('A', 'C', 'A', 'B', 'B', 'D', 'D', 'A', 'C', 'A',
'B', 'C', 'D', 'C', 'B')
            while again=='y':
                print('_-_-_-_-_-'*5)
                name=input('Enter student name:')

                filename=input('\tEnter student file name: ')
                file=open(filename, 'r')
                i=0
                choice=file.readline()
                while choice!='':
                    choice=choice.rstrip('\n')
                    ans[i]=choice
                    choice=file.readline()
                    i+=1
                    correct=0
main()
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  what is wrong with my code 53535 4 1,659 Apr-07-2022, 11:37 AM
Last Post: 53535
  What's wrong with my code? NeedHelpPython 4 2,326 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,755 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,848 Nov-20-2020, 05:32 AM
Last Post: deanhystad
  Something is Wrong with my code susmith552 4 3,118 Nov-28-2019, 02:16 AM
Last Post: susmith552
  What is wrong with my code? Than999 1 2,435 Nov-10-2019, 08:59 PM
Last Post: ichabod801
  It worked now it doesnt...ugh raymond2688 15 5,682 Aug-07-2019, 07:47 PM
Last Post: raymond2688
  A program for backing up documents (doesnt work(code is inside)) Richard_SS 4 3,517 Jun-05-2019, 03:47 PM
Last Post: heiner55
  Wrong output on my code. JTNA 2 8,010 Apr-04-2019, 01:55 PM
Last Post: JTNA
  Why is this code wrong? Lemmy 4 5,262 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