Hey there! Sign in to join this conversationNew here? Join for free

Python Beginner Projects Watch

Announcements
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    Well I started on Codeacademy.com to learn the basics, then I purchased Python Pocket Reference book by O'reiley to look up syntaxes (covers both 2.7 & 3.4). Now I just come up with small projects and try and code them. If I get stuck on a piece of code I'll look around StackOverflow for guidance.

    Also, I'm not a programmer, I'm not pursuing a career in programming. I am just learning Python in my spare time to add to my skillset because if I'm applying for a job and its me against somebody else, the Python may make me a better candidate.
    Oh ok, I think I've seen Codeacademy, I might just use that site, because I can't purchase any books or anything because I'm only 15
    Same here, I'm just learning code for fun
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Guy123)
    Oh ok, I think I've seen Codeacademy, I might just use that site, because I can't purchase any books or anything because I'm only 15
    Same here, I'm just learning code for fun
    That's ok most of the Python books are available online for free, they just sell printed versions for those that prefer them. Maybe try learnpythonthehardway.
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    That's ok most of the Python books are available online for free, they just sell printed versions for those that prefer them. Maybe try learnpythonthehardway.
    Okay, that's new, do they do them as downloadable PDFs, so I can just read them on my computer?
    Thanks, I'll try that one as well.
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Guy123)
    Okay, that's new, do they do them as downloadable PDFs, so I can just read them on my computer?
    Thanks, I'll try that one as well.
    If you google beginner python resources free then it should come up with some websites that list several free resources to learn Python.

    Are you learning 2.7 or 3.4?

    Also, Do you have python and a good IDE installed on your computer?
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    If you google beginner python resources free then it should come up with some websites that list several free resources to learn Python.

    Are you learning 2.7 or 3.4?

    Also, Do you have python and a good IDE installed on your computer?
    I haven't started learning it yet so I don't really have any knowledge on it.
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Guy123)
    I haven't started learning it yet so I don't really have any knowledge on it.
    Well I'd recommend downloading whichever Python you are planning to learn:
    https://www.python.org/downloads/

    Then Anaconda which includes Spyder IDE and lot's of useful packages:
    https://www.continuum.io/downloads

    once you've installed them just open up Spyder and you can write code from there.
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    Well I'd recommend downloading whichever Python you are planning to learn:
    https://www.python.org/downloads/

    Then Anaconda which includes Spyder IDE and lot's of useful packages:
    https://www.continuum.io/downloads

    once you've installed them just open up Spyder and you can write code from there.
    Okay then, thank you very much for your help and good luck with your projects
    • Thread Starter
    Offline

    3
    ReputationRep:
    found this website:

    https://projecteuler.net/about

    It has a series on maths problems a beginner can try to write code for.
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    found this website:

    https://projecteuler.net/about

    It has a series on maths problems a beginner can try to write code for.
    That looks interesting, is that what your using as well?
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Guy123)
    That looks interesting, is that what your using as well?
    No. Well I've not really tried any of the problems on Project Euler.


    Posted from TSR Mobile
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    No. Well I've not really tried any of the problems on Project Euler.


    Posted from TSR Mobile
    So we're both new to it then
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Guy123)
    So we're both new to it then
    Well I started learning basic syntaxes etc about 2 years ago for about a month and since then I haven't done any Python.

    I decided to pick it up again and learn more earlier this week.
    Offline

    10
    ReputationRep:
    Maybe you can look at the pygame module which allows you to create 2d games with Python, it doesn't require any special software it's just a library you can import and you can create games like snake, and any 2d game. So you could look into it and create your own mini game


    Posted from TSR Mobile
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    Well I started learning basic syntaxes etc about 2 years ago for about a month and since then I haven't done any Python.

    I decided to pick it up again and learn more earlier this week.
    Okay so you've visited it before.
    Well I've started going through the lessons now on Codecademy and it's actually really good, so we might be on the same level soon
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by CrawfordDave)
    This is what I have so far for lottery picker (normal lotto not euromillions etc) just need to add lines to ask user if they'd like to do a new set of numbers or exit:

    #imports random module#
    import random

    def random_selection():

    confirm = raw_input("Press Enter to generate lottery numbers> "
    #picks 6 numbers at random between 1-59#
    lucky_dip = random.sample((range(1,60)), 6)
    #prints the 6 random numbers in ascending order#
    print "\n",sorted(lucky_dip)

    print "\nGood Luck!"

    random_selection()
    improved it. Now It can generate numbers for lotto, Euromillions, or Thunderball. Still needs cleaning up the code but it works at least:

    """ Lottery Number Picker """

    import random

    def lotto():
    raw_input("Press Enter to generate lottery numbers> ")
    lucky_dip = random.sample((range(1,60)), 6)
    print "\n","Your Lotto Numbers are> ",sorted(lucky_dip)
    print "\nGood Luck!"
    game()

    def euro():
    raw_input("Press Enter to generate Euromillions numbers> ")
    lucky_dip_e = random.sample((range(1,51)), 5)
    stars = random.sample((range(1,12)), 2)
    print "\n","Your Euromillion Numbers are> ",sorted(lucky_dip_e)
    print "\n","And your Lucky stars are> ",sorted(stars)
    print "\nGood Luck!"
    game()

    def thunder():
    raw_input("Press Enter to generate Thunderball numbers> ")
    lucky_thunder = random.sample((range(1,40)),5)
    thunderball = random.sample((range(1,15)),1)
    print "\n Your Thunderball numbers are> ",sorted (lucky_thunder)
    print "\n and your Thunderball is> ",thunderball
    print "\n Good Luck!"
    game()

    def game():
    selection = raw_input("Type 'lotto', 'euro', or 'thunderball'> ")
    if selection == "lotto":
    lotto()
    if selection == "euro":
    euro()
    if selection == "thunderball":
    thunder()
    else:
    game()

    game()
    • Thread Starter
    Offline

    3
    ReputationRep:
    Darn it, the indentation comes out all messed up when I copy + paste my code! Oh well you get the idea
    Offline

    19
    ReputationRep:
    (Original post by CrawfordDave)
    Darn it, the indentation comes out all messed up when I copy + paste my code! Oh well you get the idea
    you can put it in a codeblock by using the # button in advanced edit & that'll save your indentation.
    • Thread Starter
    Offline

    3
    ReputationRep:
    (Original post by Joinedup)
    you can put it in a codeblock by using the # button in advanced edit & that'll save your indentation.
    thanks i wasn't aware of that feature
 
 
 
  • 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
    Should Spain allow Catalonia to declare independence?
    Useful resources
  • 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.