Python Forum
i lied it is homework and i need help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i lied it is homework and i need help
#1
so my mate knows me as a coder but i told him i could do it but i cant do it so guys i need your help ,just so u know its not home work or anything like that its just for a mate,heres what he needs:

he need a music quiz for python, where a random song is stored in an external file. The artist and the first letter of each word in displayed
The user has 3 chances to guess the song
There must be a points system. More for correct on first guess preferably
The game ends when they choose the incorrect answer twice.

Must:
Allow a player to enter their details such as name etc.
Must be in external file
Selects random song from that file
Displays the number of points they have at the end of the game and their username
Displays their score and the name of the top 5 players.

Thanks,
jamie Smile
Reply
#2
Sorry to disappoint you, but we've seen that assignment verbatim in the past...
Post your code in python tags, any traceback in error tags, ask specific question when you are have specific problem.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I think you're lying... Let's assume that you're trying to impress some friend and really said you could do it. Would your friend give you a list like this:
Quote:Must:
Allow a player to enter their details such as name etc.
Must be in external file
Selects random song from that file
Displays the number of points they have at the end of the game and their username
Displays their score and the name of the top 5 players.
I doubt it... It looks like assignment/homework specification. You wouldn't care that much about such details if your story was true.
I think I was too quick to judge... But why is your friend needing it? Is it going to be a part of some larger project? Or is it just his homework?
Reply
#4
(May-23-2019, 09:41 AM)JamieBR56 Wrote: so my mate knows me as a coder but i told him i could do it but i cant do it so guys i need your help
Even if i believed your story i still wouldnt give you the program. Based on this you lied to your friend and now want us to do the work, and you to take the credit. How about just learning to actually code? Then you can do it yourself.
Recommended Tutorials:
Reply
#5
(May-23-2019, 06:32 PM)metulburr Wrote: Even if i believed your story i still wouldnt give you the program. Based on this you lied to your friend and now want us to do the work, and you to take the credit. How about just learning to actually code? Then you can do it yourself.
micseydel and buran like this post

well i know basic python stuff ,not alot though

(May-23-2019, 02:06 PM)michalmonday Wrote: I think I was too quick to judge... But why is your friend needing it? Is it going to be a part of some larger project? Or is it just his homework?
its not homework its for a project for..i dont know to to call it tis like a group of ppl who code and he just joined and yh ,so its not homework

(May-23-2019, 10:53 AM)buran Wrote: Sorry to disappoint you, but we've seen that assignment
sorry its not an assignment me and my mates have done with school this is not school as we no longer do shcool and this an free time project my mate wants to do so yh ,not an assignment

(May-23-2019, 09:41 AM)JamieBR56 Wrote: so my mate knows me as a coder
yh he know me that cos we went to school together and i could code then , but then i kinda stopped being good at code ,which he dont know

(May-23-2019, 06:32 PM)metulburr Wrote: Based on this you lied to your friend and now want us to do the work, and you to take the credit.
i didnt lie he just thinks im still good at coding,and i wouldnt take all credit ,i would say i set a python fourm and the ppl on there helped me ,but clearly you wont ,so yh looks like there is no credit at the moment

k, guys im sorry but this is all a lie and i did it before i read the rules about homework and erm yh im sorry
yh just got to this link im sorry i lied
Reply
#6
k so mabey i lied about when i posted this before but then i read the rules of homework yh so sorry guys.dont judge me for lieing .
this is the homework:
Noel is creating a music quiz game.
The game stores a list of song names and their artist
(e.g. the band or solo artist name). The player needs to
try and guess the song name.
The game is played as follows:
• A random song name and artist are chosen.
• The artist and the first letter of each word in the song title are displayed.
• The user has two chances to guess the name of the song.
• If the user guesses the answer correctly the first time, they score 3 points. If the user guesses
the answer correctly the second time they score 1 point. The game repeats.
• The game ends when a player guesses the song name incorrectly the second time.
Only authorised players are allowed to play the game.
Where appropriate, input from the user should be validated.
Design, develop, test and evaluate a system that:
1. Allows a player to enter their details, which are then authenticated to ensure that they are an
authorised player.
2. Stores a list of song names and artists in an external file.
3. Selects a song from the file, displaying the artist and the first letter of each word of the song title.
4. Allows the user up to two chances to guess the name of the song, stopping the game if they guess
a song incorrectly on the second chance.
5. If the guess is correct, add the points to the player’s score depending on the number of guesses.
6. Displays the number of points the player has when the game ends.
7. Stores the name of the player and their score in an external file.
8. Displays the score and player name of the top 5 winning scores from the external file.

this is what i done so far:
def menu():
        print("welcome to the music guessing on python ")
        time.sleep(1)
        print("you must be logged in to take the quiz")
        time.sleep(1)
        while True:
                username = input("please enter username")

                if username == "hi":
                    print("username is correct")
                    
                    break
                else:
                    print("Incorrect username Try again.")

        while True:
                password = input("please enter password")

                if password == "hi":
                    print("password is correct")
                    
                    break
                else:
                    print("Incorrect password Try again.")

        print("you are now logged in")

score = 0
print("")
    
artist1 = ['Michael Jackson']
song1 = ['Billy Jean']
def guess1artist1():
        print("guess the name of the artist,in 3 guesses")
        time.sleep(1)
        print("guess1,first letter of name is",artist1[0][0])
        print("clue :he was born on:29 August 1958,he died on 25 June 2009")
        guess1 = input ("please enter guess,(Capital Leters For Names)")
        if guess1 !="Michael Jackson":
                print("incorrect guess,2 more guesses left")
                
                

        if guess1 =="Michael Jackson":
                print("correct guess")
                score = score+3




def guess2artist1():
        print("guess2,seccond letter of name is",artist1[0][1])
        guess2 = input ("please enter guess,(Capital Leters For Names)")
        if guess2 !="Michael Jackson":
                print("incorrect guess,1 more guesses left")
                

                

        if guess2 =="Michael Jackson":
                print("correct guess")
                score = score+2




def guess3artist1():                
        print("guess3,third letter of name is",artist1[0][2])
        guess3 = input ("please enter guess,(Capital Leters For Names)")
        if guess3 !="Michael Jackson":
                print("incorrect guess,0 more guesses left")
                

        if guess3 =="Michael Jackson":
                print("correct guess")
                score = score+1

print("Score:",score)



        

def guess1song1():  
        print("now you have 3 guesses to guess 1 of his songs")
        time.sleep(1)
        print("guess1,first letter of song is",song1[0][0])
        guess1 = input ("please enter guess,(Capital Leters For Names)")
        if guess1 !="Billy Jean":
                print("incorrect guess,2 more guesses left")
                

        if guess1 =="Billy Jean":
                print("correct guess")
                score = score+3




        


        
def guess2song1():  
        print("guess2,seccond letter of name is",song1[0][1])
        guess2 = input ("please enter guess")
        if guess2 !="Billy Jean":
                print("incorrect guess,1 more guesses left")
                

        if guess2 =="Billy Jean":
                print("correct guess")
                score = score+2






        



def guess3song1():  
        print("guess3,third letter of name is",song1[0][2])
        guess3 = input ("please enter guess")
        if guess3 !="Billy Jean":
                print("incorrect guess,0 more guesses left")
                print("Score:",score)
                
        if guess3 =="Billy Jean":
                print("correct guess")
                score = score+1
                
                


import time

guess1artist1()
guess2artist1()
guess3artist1()
guess1song1()
guess2song1()
guess3song1()

Output:
Score: 0 guess the name of the artist,in 3 guesses guess1,first letter of name is M clue :he was born on:29 August 1958,he died on 25 June 2009 please enter guess,(Capital Leters For Names)m incorrect guess,2 more guesses left guess2,seccond letter of name is i please enter guess,(Capital Leters For Names)mi incorrect guess,1 more guesses left guess3,third letter of name is c please enter guess,(Capital Leters For Names)michael incorrect guess,0 more guesses left now you have 3 guesses to guess 1 of his songs guess1,first letter of song is B please enter guess,(Capital Leters For Names)b incorrect guess,2 more guesses left guess2,seccond letter of name is i please enter guessi incorrect guess,1 more guesses left guess3,third letter of name is l please enter guessl incorrect guess,0 more guesses left Traceback (most recent call last): File "N:\J276 PROGRAMMING PROJECT\Task1.py", line 146, in <module> guess3song1() File "N:\J276 PROGRAMMING PROJECT\Task1.py", line 130, in guess3song1 print("Score:",score) UnboundLocalError: local variable 'score' referenced before assignment >>>
Reply
#7
You're never going to get there that way. You are repeating your code for each question, hard coding everything. First you want to have your data in a list, probably a list of tuples, like so: [('Michael Jackson', 'Billy Jean'), ('Nine Inch Nails', 'Burning Inside'), ('Black Sabbath', 'Iron Man')]. Remember, the songs are supposed to be stored in a file, so you will need to read the file into that list. Then you can loop through the list, getting the band and song, converting the song to first letter of each word, and then asking the quesstion.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

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