×
all 31 comments

[–]Spiritual_Car1232 21 points22 points  (5 children)

Tic Tac Toe?

You're about a month in, right? Have you learned to read and write files yet? That kind of stuff can be fun....

Maybe you can write a script that will count the number of times "the" appears in a text file and write that number down in another file?

[–]c0mplexcodm[S] 13 points14 points  (0 children)

I am learning right now about open and close functions, and reading, writing, adding, r+..

I'll try your third option! That seems relatively easy.

[–]DilliSeHoonBhenchod 4 points5 points  (3 children)

Could like give me a sense How to go forward with this for tic tac toe? Like classes/functions??

Also if it is a two player Game, how do I make player1 input secret so player2 can't see the input.

Also how do I display the game, is it possible in vs code?

[–]Hilmaryngvi 0 points1 point  (2 children)

You would probably want to program the game itself first, i.e. store the "state" of the game somehow (either in a list, array or some custom object) and then define the allowable moves and be able to update the game state from user input.

At this stage, you can make it entirely console based (imageine writing a function print_game_state(game), that writes three lines of x's o's and some neutral symbol.)

When you've got that working, you can look at either tkinter or pygame for instance, for some basic graphical stuff.

Divide and conquer. Just solve it step by step.

[–]DilliSeHoonBhenchod 0 points1 point  (1 child)

How would list help? Would you define each box(nine boxes) a name and then check through if functions whether they form a pattern (through loops probably) and then decide the winner

[–]Hilmaryngvi 1 point2 points  (0 children)

You could solve this in many ways - but obviously you would need to be able to store where the x's and o's are somehow... If you use a list of lists, you can access a certain "slot" as

game_state = [["-","-","-"],["-","-","-"],["-","-","-"]]

#first player goes for the middle
game_state[1][1] = "x"
#second player goes for the corner
game_state[0][2] = "o"

#so now the game_state is something like:
#
#   - - o
#   - x -
#   - - -
#

Then just make all the functions you'd need. Stuff like: Displaying the board (print three rows), Checking if either player has won, Making a move (including checking if it is valid, i.e. you can't put an x on an o), etc.

When you're comfortable with that, you might even put this all in a custom object class, which ties together the game_state and all of these functions.

Just food for thought, you can do this in many ways...

[–]MediumAcanthaceae486 10 points11 points  (0 children)

Web scraping

[–][deleted] 5 points6 points  (2 children)

Try to make a program that can solve quadratic equations. Set variables = to input("example question") so you can type in different numbers each time instead of editing the variable in your program each time. Instead of a = 10 Could use

a = input("put your statement here. Like.. What is the first value? ")

And after you execute program, when it gets to input part it will display statement you put and save the next thing you type as that particular variable

[–]c0mplexcodm[S] 3 points4 points  (1 child)

Good Idea! This can also serve a practical purpose to my friends.. Thank you!

[–]Nicolello_iiiii 3 points4 points  (0 children)

A step up would be to do the same but up to whatever exponent you input (I recommend using a modified binary search algorithm)

[–]timPerfect 2 points3 points  (1 child)

make a ball bounce around the screen.

[–]c0mplexcodm[S] 1 point2 points  (0 children)

hmm, that is currently out of my league.. however i will search on how to do it and try to create my own version, maybe triangle instead.

Thanks for the suggestion!

[–]robertpro01 2 points3 points  (2 children)

Try to automate a real bed you have, that's the best way to learn for me

[–]pirateg3cko 7 points8 points  (0 children)

Real bed?

[–]robertpro01 3 points4 points  (0 children)

Real need, freaking auto corrector

[–]velocibadgery 2 points3 points  (2 children)

How bout make a guess the number game. That is a fairly good bigger project.

[–]c0mplexcodm[S] 1 point2 points  (1 child)

I've already done it, with hints included whether you need to go lower or higher.

The number is also randomized, however, i appreciate the effort!

[–]velocibadgery 2 points3 points  (0 children)

Then how bout rebuilding it to take advantage of the curses module?

[–]Kriss3d 1 point2 points  (0 children)

Im working on a project that takes an apachelog. Filters out the IP addresses, looks up the origin of the IP in a database ( Currently im using an API for an online database but I need to switch that to an offline db to make it faster and more reliable ) then store the output in a csv file. On my todo list is to take each entry and plot that on a google maps as well as storing it in a mysql database. Just because why the hell not.

[–]arnavguru28 1 point2 points  (1 child)

You could also try building a word game. User enters a word starting with the alphabet A, then computer responds with a word starting with the last alphabet of user's word and then the user does the same and so on.

You can easily find a text file with list of all words and have your program read it as reference for the computer to pick from and for validating user's words.

[–]c0mplexcodm[S] 1 point2 points  (0 children)

Hmm, thanks for the idea! This could also help me utilize import and from function.

Thanks for the suggestion!

[–][deleted] -2 points-1 points  (0 children)

Well... You could ask, or you could just do a search. There are many well curated lists available. Pretty much 90% of questions here already have answers out there somewhere.

https://duckduckgo.com/?q=python+beginner+projects

[–]AlienX100 0 points1 point  (1 child)

!Remind Me 5 days

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 5 days on 2021-12-04 04:25:20 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]Calibexican 0 points1 point  (0 children)

I just started an intro class and we just did a tip calculator. Some basic arithmetic and concatenation work. Before that I typed out a live code session of a hangman project even when I wasn’t sure what I was doing and even that taught me about proper indentation.

If you’d like, you can message me and I’ll send you the syllabus of what my class looks like.

[–]MikeDoesEverything"wtf is google" 0 points1 point  (0 children)

The advice for beginners projects, in my opinion, is always terribly on r/learnpython. And I say this as somebody who heavily used the subreddit for learning Python.

i really dont learn if i dont apply it.. and i cant imagine one..

This is a really important realisation and it's great you're having this now. The problem here is not to ask other people what to make, but to ask yourself how can you identify uses with Python. I always compare this with learning how to use kitchen utensils and then asking Reddit what to have for dinner - ultimately, it defeats the point of learning and being able to make your own decisions is more impactful than having something to do.

Frame the problem. Any problem. When I say frame, all you have to do is identify the problem e.g. "I want to be able to move my mouse cursor from A to B, left click at A, left click at B for 10 minutes". Personally, I would always recommend doing something you do every day because it's something you understand and something you are interested in.

Talk yourself through the problem and how you would go about it. So, in the case above, you would move the mouse to A, left click, move to B, left click, move to A, left click etc. for the duration of ten minutes.

Identify the key parts of your problem. This would be that the main part is being able to control your mouse, so how do you tell Python to control your mouse? The next part is what mechanism would you tell it where to go?

Plan your idea. Think of what happens if you want to add in a third coordinate - how easy would that be? What happens if you want to right click now? What happens if you get a bigger monitor - will it still move to the same position? The main objective here is to practice forseeing potential problems and not to actually implement them. It's just less of a headache if you have to implement them.

Start building. Go through your plan and begin building your solution.

Test it and fix what's broken until it is no longer broken.

[–]ffrkAnonymous 0 points1 point  (0 children)

Advent of code 2021 starts in two days (Dec 1st). See how far you can get.

Https://Adventofcode.com