The Student Room Group

Python Beginner Projects

Hi, So I'm pretty new to programming/coding and have started to learn Python (2.7) as my first language and thought I'd start this thread as a place for people to post simple/beginner coding projects for new Python learners to try and complete.

So far the things I've made which beginners could try:

An 8-Ball (ask a question, gives a random (Yes, no, maybe, etc.) answer)

An English to Pig Latin translator (I called mine the Pig Latinator)

Addition of two given numbers

An egg timer (great for implementing TKinter)


So if you have any other beginner projects using Python please post so learners have some practical projects they can start writing code for.

:smile:

Scroll to see replies

Hangman game :3
(hard for beginners but possible)
Original post by CrawfordDave
Hi, So I'm pretty new to programming/coding and have started to learn Python (2.7) as my first language and thought I'd start this thread as a place for people to post simple/beginner coding projects for new Python learners to try and complete.

So far the things I've made which beginners could try:

An 8-Ball (ask a question, gives a random (Yes, no, maybe, etc.) answer)

An English to Pig Latin translator (I called mine the Pig Latinator)

Addition of two given numbers

An egg timer (great for implementing TKinter)


So if you have any other beginner projects using Python please post so learners have some practical projects they can start writing code for.

:smile:


Lottery number picker (that doesn't pick the same number more than once per set)
Palindrome tester
Prime number generator
Prime factoriser

some of the easy questions on sites like
https://www.codechef.com/problems/school
https://projecteuler.net/archives
Original post by Student403
Hangman game :3
(hard for beginners but possible)

I don't think I'm at that level yet but I'll definitely attempt it when I'm more confident, thanks though

Original post by Joinedup
Lottery number picker (that doesn't pick the same number more than once per set)
Palindrome tester
Prime number generator
Prime factoriser

some of the easy questions on sites like
https://www.codechef.com/problems/school
https://projecteuler.net/archives


I will try the lottery number picker because that sounds quite simple to do. I forgot to mention that there are a few projects a beginner could try posted on Reddit:

https://www.reddit.com/r/beginnerprojects
Original post by CrawfordDave
I don't think I'm at that level yet but I'll definitely attempt it when I'm more confident, thanks though



I will try the lottery number picker because that sounds quite simple to do. I forgot to mention that there are a few projects a beginner could try posted on Reddit:

https://www.reddit.com/r/beginnerprojects

I'd recommend you try the palindrome tester. It's a great one
Original post by Student403
I'd recommend you try the palindrome tester. It's a great one


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> ":wink:
#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()
(edited 8 years ago)
Original post by CrawfordDave
Hi, So I'm pretty new to programming/coding and have started to learn Python (2.7) as my first language and thought I'd start this thread as a place for people to post simple/beginner coding projects for new Python learners to try and complete.

So far the things I've made which beginners could try:

An 8-Ball (ask a question, gives a random (Yes, no, maybe, etc.) answer)

An English to Pig Latin translator (I called mine the Pig Latinator)

Addition of two given numbers

An egg timer (great for implementing TKinter)


So if you have any other beginner projects using Python please post so learners have some practical projects they can start writing code for.

:smile:


As one of our beginning projects at school, our teacher had us code a Battleships text game using an array to store ship positions, then change the position character to an X when hit.

Other projects include a way of converting binary numbers to denary and backwards.
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:

import random

def random_selection():

numbers = range(1,60)

confirm = raw_input("Press Enter to generate lottery numbers> ":wink:

lucky_dip = random.sample((range(1,60)), 6)

print sorted(lucky_dip)

random_selection()

Gotta be honest it's been a few months since I wrote my last line of code xD But I think your idea is good
Original post by Dapperblook22
As one of our beginning projects at school, our teacher had us code a Battleships text game using an array to store ship positions, then change the position character to an X when hit.

Other projects include a way of converting binary numbers to denary and backwards.


Thanks for the additions, I think I actually did battleships once (and tictactoe in a similar way) as part of an online tutorial for Python. I'm sure other Python newbies will want to try it out.
Original post by Student403
Gotta be honest it's been a few months since I wrote my last line of code xD But I think your idea is good

Thanks, I just added a print statement after the numbers are printed saying "Good Luck!" to make it a bit nicer :P
Original post by CrawfordDave
Thanks, I just added a print statement after the numbers are printed saying "Good Luck!" to make it a bit nicer :P


I love improving the user experience xD That's like my favourite part
chess AI
Another code I have written which is fairly simple is a Scrabble word scorer (user enters a word and then you calculate how much the word scores), tip: you can use a dictionary to store scores to letters.
Original post by Student403
I love improving the user experience xD That's like my favourite part


Just thought I'd give kudos on the Spoderman pic
Reply 14
Battleships sounds like a fun ! Simple console game
2d array to store the ships on the board. Draw ships as # whilst empty cells are . and ship hits shown as x.

Make the user guess shots with user input.
Create an enemy CPU opponent that picks at random but then restricts his guesses to within a certain range of a successful hit till he gets a kill.

Damn I want to write this game :tongue:
(edited 8 years ago)
Original post by CrawfordDave
Just thought I'd give kudos on the Spoderman pic


Cheers xD
Reply 16
Checking whether a word is a palindrome is a good one and pretty easy. Do FizzBuzz if you haven't already.
Reply 17
Original post by CrawfordDave
Hi, So I'm pretty new to programming/coding and have started to learn Python (2.7) as my first language and thought I'd start this thread as a place for people to post simple/beginner coding projects for new Python learners to try and complete.

So far the things I've made which beginners could try:

An 8-Ball (ask a question, gives a random (Yes, no, maybe, etc.) answer)

An English to Pig Latin translator (I called mine the Pig Latinator)

Addition of two given numbers

An egg timer (great for implementing TKinter)


So if you have any other beginner projects using Python please post so learners have some practical projects they can start writing code for.

:smile:


Where are you learning Python? I'm currently learning html from w3schools and eventually want to start learning Python as well.
Original post by INTit
Battleships sounds like a fun ! Simple console app
2d array to store the ships. Draw ships as # whilst empty cells are . and hit ships shown as x.

Make the user guess shots with user input.
Create an enemy CPU opponent that picks at random but then restricts his guesses to within a certain range of a successful hit till he gets a kill.

Damn I want to write this game :tongue:


Are you learning Python, or even good at python? do it. I always get satisfaction when I finally get my code working as I want it.

Oh and another thing a beginner can try is a text based story game. You can add any number of things such "health" which decreases when you get hit by an enemy, "stamina". You can even create commands for a user to input such as use potion which can increase the health or state that you have no potions etc.
Original post by Guy123
Where are you learning Python? I'm currently learning html from w3schools and eventually want to start learning Python as well.


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.
(edited 8 years ago)

Quick Reply

Latest

Trending

Trending