Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    1
    ReputationRep:
    I've decided to learn python, but I'm an absolute beginner. All I know is the basic syntax, pretty much. Is anyone else in a similar situation, and interested in a learning buddy?

    We could keep each other motivated
    Offline

    0
    ReputationRep:
    yeh im up for it!!
    Offline

    0
    ReputationRep:
    Already did.
    It's a great first language but now I hate it.
    What do you mean by basic syntax? There's not that much to learn after the basics really, just task specific things.
    Offline

    19
    ReputationRep:
    Parseltongue > Python.
    Offline

    2
    ReputationRep:
    (Original post by TattyBoJangles)
    Parseltongue > Python.
    Kill.....
    Offline

    16
    ReputationRep:
    (Original post by elephantinc)
    There's not that much to learn after the basics really
    If you think this of any language then you haven't learnt it properly.
    • Thread Starter
    Offline

    1
    ReputationRep:
    (Original post by jackhughesie)
    yeh im up for it!!
    Cool. I couldn't find anyone in the real world that wanted to. Lazies, the lot of them
    Offline

    14
    ReputationRep:
    I keep meaning to, and then not getting round to it >< I even installed a bunch of programs on my computer aimed at teaching young children how to code! Perfect, as that's really the level I need complicated things pitched to me at :p:
    Offline

    0
    ReputationRep:
    (Original post by Planto)
    If you think this of any language then you haven't learnt it properly.
    I did say besides task specific things. Once you have the basics down, you tend to learn things as you need them.
    Offline

    2
    ReputationRep:
    I found an amazing "free or donate" ebook but have since lost it!

    Also ITT: female programmers... something is not quite right here! :P
    Offline

    2
    ReputationRep:
    More than welcome to play my game



    #Rock, Paper, Scissors game. Written by Luke Presland

    import random

    computer_score = 0
    user_score = 0
    draw_score = 0

    print "Welcome to Rock, Paper, Scissor!"
    print ""

    def main():
    global computer_score
    global user_score
    global draw_score




    for i in range (1):
    computer = random.randint(1, 3)
    print "The computer has already chosen."
    print ""
    user = validated_input("Choose either 1 for Rock, 2 for Paper or 3 for Scissors: ")
    print ""

    print "The computer has chosen:", computer
    print "You have chose:", user

    if user == computer :
    draw_score = draw_score + 1
    print "Draw! Please play again."
    loop()
    elif user == 1 and computer == 2 :
    user_score = user_score + 1
    print "Paper beats Rock. You Win!"
    loop()
    elif user == 2 and computer ==1 :
    computer_score = computer_score + 1
    print "Paper beats Rock. Computer Wins. Try again!"
    loop()
    elif user == 2 and computer == 3 :
    computer_score = computer_score + 1
    print "Scissors beat Paper. Computer Wins. Try again!"
    loop()
    elif user == 3 and computer == 2 :
    user_score= user_score + 1
    print "Scissors beat Paper. You Win!"
    loop()
    elif user == 1 and computer ==3 :
    user_score = user_score + 1
    print "Rock beats Scissors. You Win!"
    loop()
    elif user == 3 and computer == 1 :
    computer_score = computer_score + 1
    print " Rock beats Scissors! Computer Wins. Try again!"
    loop()

    return computer_score
    return user_score
    return score_draw


    def validated_input(prompt):
    user = input(prompt)
    while user > 3 or user <1 :
    user = input("Choose either 1 for Rock, 2 for Paper or 3 for Scissors: ")
    return user


    def loop():
    print ""
    again = input("Do you want to play again? Enter any number to continue or 0 to quit and show results. ")
    while again != 0 :
    main()
    again = input("Do you want to play again? Enter any number to continue or 0 to quit and show results.")
    else :
    global user_score
    global computer_score
    global draw_score
    print""
    print " \t \t \t The Results"
    print "-----------------------------"
    print "You: %s " %(user_score)
    print "The Computer: %s " %(computer_score)
    print "Draws: %s " %(draw_score)
    print ""
    if user_score > computer_score :
    print "Well done! You have won!"
    elif computer_score > user_score :
    print "Sorry! The computer won this time. Try again next time!"
    elif user_score == computer_score :
    print "It was a draw this time! Try again next time!"


    main()
    • Thread Starter
    Offline

    1
    ReputationRep:
    (Original post by unrealnumbers)
    More than welcome to play my game
    would you mind explaining how to use return to me? It takes a value back to the 'main program', apparently, but when do you have to use it and when can you just 'name' a variable and use that?... Sorry if this is a bit confused



    (Original post by Javindo)
    I found an amazing "free or donate" ebook but have since lost it!

    Also ITT: female programmers... something is not quite right here! :P
    Are you studying compsci? I looked at the stats, there are so many men!
    Offline

    2
    ReputationRep:
    (Original post by Melanie-v)
    would you mind explaining how to use return to me? It takes a value back to the 'main program', apparently, but when do you have to use it and when can you just 'name' a variable and use that?... Sorry if this is a bit confused

    I do not know Python but from my programming experience, a "return" is what a function can quite literally "return/send back" when called so for example (pseudocode) (may need to scroll down):
    Code:
    function Test(){
    
    string = "Hello world" return string
    } Output Test()
    This would output "Hello world".

    I hope that sort of makes sense! An example would be "if this function returns true, carry on" etc.




    Are you studying compsci? I looked at the stats, there are so many men!

    I hope to study it at uni and currently study "Computing" at A level.
    Responses in bold
    Offline

    10
    ReputationRep:
    (Original post by Melanie-v)
    I've decided to learn python, but I'm an absolute beginner. All I know is the basic syntax, pretty much. Is anyone else in a similar situation, and interested in a learning buddy?

    We could keep each other motivated
    Hey, I have recently started teaching myself Python.
    I would be greatly interested in learning with you and we can share guides and give each other small programming challenges

    Send me a message if you're interested and everyone else in this thread to ^_^
    Offline

    2
    ReputationRep:
    this is a good site i recommend to start learning languages

    http://www.thenewboston.com/?cat=40&pOpen=tutorial
    Offline

    0
    ReputationRep:
    I've done some python in my time, its a really fun language and I certainly wouldn't mind going over it again.

    If you need any help on where to start/materials/resources/general advice/[insert problem here]
    send me a PM.
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Did TEF Bronze Award affect your UCAS choices?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.