Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Default [CODE] PyChoice [Python]

    Hey guys this is a simple python code I started, I'm probably not the first person, but if you have any question just ask and I'll answer(if I can )

    Code:
    print 4+9*4 
    print "Thats the secret number"
    
    
    def Hi ():
        print "You've just entred a Phoenix Wright Case"
        print "You would like  PW or Edgey?"
        answer = raw_input("Type Pw or Edgey and hit enter'.")
        if answer == "PW" or answer== "pw" or answer== "Pw":
            print "Correct Answer!"
        elif answer == "Edgey" or answer=="edgey" or answer=="EDGEY":
            print "Wrong answer Try again."
            Hi()
        else:
            print "You didn't pick,Try again."
            Hi()
         
    Hi()
    *Hope this is in the right section.*

  2. #2
    Join Date
    Jan 2011
    Location
    England, United Kingdom
    Posts
    253
    Tokens
    40
    Habbo
    Pegle

    Latest Awards:

    Default

    I would recommend upgrading from 2.7 (or whatever you have) to 3.2.3 as it's much easier to code Python in the newer models.

    EDIT: Apart from having to add brackets everywhere :rolleyes: it's a nice script
    Last edited by Pegle; 10-08-2012 at 08:56 AM.


  3. #3

    Default

    Quote Originally Posted by Pegle View Post
    I would recommend upgrading from 2.7 (or whatever you have) to 3.2.3 as it's much easier to code Python in the newer models.

    EDIT: Apart from having to add brackets everywhere :rolleyes: it's a nice script
    Thanks and I plan to to upgrade soon.

  4. #4
    Join Date
    Jan 2011
    Location
    England, United Kingdom
    Posts
    253
    Tokens
    40
    Habbo
    Pegle

    Latest Awards:

    Default

    Ponies.

    Um by the way that script wouldn't work as in your input you are using a ' to start but a " to end.


  5. #5

    Default

    Quote Originally Posted by Pegle View Post
    Ponies.

    Um by the way that script wouldn't work as in your input you are using a ' to start but a " to end.
    I see what your saying, but that's for signature and I'll fix it now, I didn't even notice that. Ponies

  6. #6
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Code:
    print 4+9*4 
    print "Thats the secret number"
    
    
    def Hi():
        print "You've just entred a Phoenix Wright Case"
        print "You would like  PW or Edgey?"
        answer = raw_input("Type Pw or Edgey and hit enter: ")
        answer.lower()
        if answer == "pw":
            print "Correct Answer!"
        elif answer == "edgey":
            print "Wrong answer Try again."
            Hi()
        else:
            print "You didn't pick,Try again."
            Hi()
    Hi()
    Also, functions should return something in Python, it's good practice.
    Last edited by Recursion; 10-08-2012 at 07:38 PM.
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  7. #7

    Default

    Quote Originally Posted by Recursion View Post
    Code:
    print 4+9*4 
    print "Thats the secret number"
    
    
    def Hi():
        print "You've just entred a Phoenix Wright Case"
        print "You would like  PW or Edgey?"
        answer = raw_input("Type Pw or Edgey and hit enter: ")
        answer.lower()
        if answer == "pw":
            print "Correct Answer!"
        elif answer == "edgey":
            print "Wrong answer Try again."
            Hi()
        else:
            print "You didn't pick,Try again."
            Hi()
    Hi()
    Also, functions should return something in Python, it's good practice.
    It is, but this was just a sample code from a bigger project I'm working on. I'll make it return something, soon.

    Thanks for the feedback guys.

  8. #8
    Join Date
    Jan 2011
    Location
    England, United Kingdom
    Posts
    253
    Tokens
    40
    Habbo
    Pegle

    Latest Awards:

    Default

    Any clues as to what this project is @A.Justice;?


  9. #9

    Default

    Quote Originally Posted by Pegle View Post
    Any clues as to what this project is @A.Justice;?
    Yes, for now it's going to be a word RPG(ikr there's a first time for everything), which I'll then make into a Phoenix Wright Case, using PyWright. Then an RPG game so yea it has it stages. Alot @Pegle

  10. #10

    Default

    Quote Originally Posted by Pegle View Post
    Any clues as to what this project is @A.Justice;?
    Yes, for now it's going to be a word RPG(ikr there's a first time for everything), which I'll then make into a Phoenix Wright Case, using PyWright. Then an RPG game so yea it has it stages. Alot @Pegle

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •