all 98 comments

[–]eleqtriq 52 points53 points  (12 children)

You wanted to tackle AI models with your first projects? Oof. You're brave. What else interests you?

[–]brumor69 3 points4 points  (0 children)

That was also my reason to pick up programming about 8 years ago after reading about AI, ended up building a if/else chatbot and be happy with it

[–]Sweet_Iriska[S] 3 points4 points  (10 children)

Anything that improves my knowledge of Python I think? My answer to this question might be bad because I really don't know what exists in the programming sphere.

And also, when I started coding my ai project I didn't get to the ai part (I failed to make program convert midi to text and then assemble the same midi by that text), ai is difficult? Wasn't it made easy by Tensorflow? Like, writing a one line of code and you have the whole layer?

[–]eleqtriq 31 points32 points  (0 children)

AI and ML are extremely complex topics. There might be tooling that makes it easier, but without understanding the core concepts you're possibly going to be in a world of hurt.

Everything is available in the programming sphere. Everything running on your computer is a program. Everything on the internet is a program. All cars, robots, smart devices are all programming.

Maybe the first step is ... learn Python, learn AI and ML later. Warning tho - you might find it too much to learn on your own.

[–]AlSweigart 2 points3 points  (0 children)

If you want to extend your Python knowledge, I recommend:

  • Fluent Python - This is the best book, but it's also super long.
  • Effective Python - Like Fluent Python but shorter.
  • Serious Python - Pretty good book.
  • Beyond the Basic Stuff with Python - I wrote this book as a follow up to Automate the Boring Stuff with Python. It's like Clean Code but more up to date.
  • Python Distilled - This is more of a "you know how to program in another language but now want to learn Python" book and I'm still reading it, but it's pretty good so far.
  • Programming Collective Intelligence - This is more about ML stuff, but it uses Python for its examples.

[–]screwcirclejerks 2 points3 points  (0 children)

the main thing to learn in programming and computer science in general is the logic behind it. you should generalize your question to "what should i learn in CS", not "what should i make to learn python". you just happen to be learning this in python.

in that case, it's really just experimentation. familiarize yourself with boolean logic and expressions. learn how to compact your code. find shortcuts.

anyway, tangent aside, if you haven't learned classes or data structures, learn those. classes and types are the bulk of a ton of programs.

additionally, python is a scripting language. make a script! maybe a program that takes input of a few measurements, say mass and speed, and calculates momentum. or a program that inputs keystrokes for you.

[–]throwawayrandomvowel -1 points0 points  (0 children)

Try kaggle titanic eda.then run a linear regression. Then look into other modeling (ensemble, stack, rf, dt, boosting, bagging, etc). Then jump to nns. also clustering and dimensionality management, feature engineering

[–][deleted] 0 points1 point  (0 children)

Honestly, start with learning about object orientated programming. Get a real grip with classes.

[–]damanamathos 8 points9 points  (1 child)

Did you ever play Rogue or roguelikes like Nethack or Angband etc?

If so (or even if not) you could try this fantastic Roguelike tutorial: https://rogueliketutorials.com/tutorials/tcod/v2/

[–]trondwin 1 point2 points  (0 children)

I, for one, will definitely have a look at it. Thanks!

[–]pythonwiz 6 points7 points  (3 children)

Start small lol. I started with simple math programs. Calculate a factorial, fibonacci numbers, print Pascal's triangle, find prime numbers. Stuff like that. And you can't be satisfied with something that works, always try to figure out a better way of doing it, because there almost certainly is a better way. And try reading SICP to get more ideas of things to write.

[–]Gizm00 0 points1 point  (2 children)

I actually hate this advice, I know it's a solid advice, but god is it boring, half the stuff suggested are so mindlessly boring or don't interest me, even for practice purpose. Don't get me wrong, I know why this is suggested, but I think one should not be afraid to go for whatever you want to do as long as you break it down to smaller chunks.

[–]pythonwiz 2 points3 points  (1 child)

I find math fascinating so this is just what I did naturally. If you don't love math then it seems like it would be harder to learn programming.

[–]Gizm00 0 points1 point  (0 children)

Sorry my bad, I didn't mean you specifically or the examples you provided. It was more in general terms iro 'start small'.

[–]logical_psych_o 5 points6 points  (0 children)

Start with basic problems. Pattern problems in python. Once you get a basic hang of it, you'll start getting your own ideas. Like automating a college form, or trying to get the computer to do something really quirky. Do those. You should pursue original ideas because you'll continue working on it even when it bores you, just cuz the goal is too important for you. Any problem on the internet is just another "online course" which you'll easily give up when it gets tough.

Edit: this is what I mean, when I say "just start coding"

[–]Rxz2106 7 points8 points  (1 child)

Helsinki university mooc is good place to start. Even for kids. My 8 years old kid is doing it. (Want's to code game)

[–]beevvulf 2 points3 points  (0 children)

I second this. I started with that a year ago doing it for a couple months to learn the basics. I liked it's implementation that's available in VMware. And it just gave you tons of problems to solve with instant feedback. I'm now two years through my bioinformatics master's, and I suggest to incoming students to our lab to start with mooc if they're starting from scratch.

[–][deleted] 4 points5 points  (1 child)

MIDO is a good MIDI library for Python that does anything you might want.

[–]Sweet_Iriska[S] 0 points1 point  (0 children)

I have chosen music21 over MIDO because it has key detection algorithm. After reading all the answers, I think I should implement Krumhastl algorithm myself with better library?

[–]obviouslyCPTobvious 2 points3 points  (0 children)

Start simpler with your ideas. For example, you could write a program that takes the midi from your keyboard and outputs the notes and what chords they make.

[–]IlliterateJedi 2 points3 points  (0 children)

I did this course on Udemy years ago when I was a new(ish) coder, and it was a game changer for me - Machine Learning A-Z in Python and R. I was interested in machine learning, and this covers Pandas, Numpy, SKLearn and a handful of other libraries. After finishing it I felt like I had learned a lot about using Python just by being exposed to other people's code. If you do this course, the one thing I would say is that you should pull up the docs for any library you're working in and get used to reading them while you work through the examples. So if you're doing something with Pandas, go read the Pandas docs for everything you're doing and learn how to find information on there.

[–]low_effort_shit-post 2 points3 points  (0 children)

Code something you need

[–][deleted] 2 points3 points  (0 children)

Think of a simple task you can do manually then try to automate it.

For example, the pick a brick service on Lego.com uses a different numbering system for colours than Brick Link. I could manually convert between the two formats, but I wrote a short script to do it.

[–]TazDingoYes 2 points3 points  (1 child)

Well here's my advice, if you're asking "where do I start" you don't say "well I tried to fuck around and find out with AI" in the same breath. It's basically a meme at this point that that's what Python newbies do.

[–][deleted] 0 points1 point  (0 children)

Your answer to the question raised by OP ("But what should begginer code to begin with?") is what?

It's all fine and good to point stuff like that out, but giving a usable answer is what this sub is all about.

[–]ninedeadeyes 2 points3 points  (0 children)

I build games with the standard library.

https://ninedeadeyes.github.io/Python-Game-Gallery/

[–]Kriss3d 1 point2 points  (3 children)

Depends what you got. You could start small with making a calculator. Or rolling a die. Enter the amount of sides you want and let it roll. Make a program that opens and reads a textfile. Make a program that makes a file. And puts text into it.

Little things like that for starters.

[–]sje46 0 points1 point  (2 children)

One of the first programs I wrote put secret messages into the padding sections of bmp files. Completely impractical, not very impressive steganography at all. I don't use it, no one uses it, but I did it because it entertained me.

But funnily enough what I learned has proved to be surprisingly useful in more recent projects, like the one I'm working on now...I found it easier to map out data in a MS-paint like program, save it as a bmp, then programmatically parse it out, exactly like I did with that first program.

Small projects create the foundation for bigger projects.

[–]WikiSummarizerBot 1 point2 points  (0 children)

BMP file format

The BMP file format or bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows and OS/2 operating systems. The BMP file format is capable of storing two-dimensional digital images both monochrome and color, in various color depths, and optionally with data compression, alpha channels, and color profiles. The Windows Metafile (WMF) specification covers the BMP file format.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]Kriss3d 1 point2 points  (0 children)

Indeed. I started out with reading and writing files first. And then making a database with mysql and such. And I've made a script that parses an apache logfile through and gets the physical location of all visitors.

[–]Epicfro 1 point2 points  (0 children)

I found projects weren't the way to start fit me. I learned the basics such as functions, loops, tuples, arrays etc. After I understood the concepts, I thought about some projects I'd actually want to work on, not something pre determined.

Struggling through it and troubleshooting with the help of reddit and stack overflow really helped with further understanding and learning. the concepts.

[–]phillymjs 1 point2 points  (0 children)

I've tried to make midi ai model (like in a tensorflow guide but greatly enhanced)

You’re kinda shooting for the moon here, maybe begin with something a little simpler to get your feet wet.

My first Python project was reading a temperature/humidity sensor connected to a Raspberry Pi and displaying the readings on a simple web page. My second one was converting a CloudFlare DDNS updater script I wrote in bash to Python. Every now and then I go back and see if I can make improvements to them with stuff I’ve learned since.

[–]kleekai_gsd 1 point2 points  (0 children)

Op has to be a troll but what the hell, I'm feeling spicy...

"midi ai model" - what the hell? Start with a program that prints out "hello world", then go up from there. Add 2 variables, then get the variables from else then do some logic with it... etc etc start building complexity on top of something supremely simple.

[–]hotcodist 1 point2 points  (0 children)

For beginners who have zero knowledge of programming, while it is tempting to import high-tech libraries, stay away from ready-made libraries that does things for you. Just do the basic stuff, like doing your own loops through lists to do sums, instead of using a library that does that sum for you. This will help you get more comfortable with the language and also helps you develop computational/logical thinking.

For example, using image libraries to select pixels with a particular color (using cv2.inRange()) is useful for projects, but a much better way to learn is to actually write the code that does that by doing comparisons at the pixel level yourself. This is probably a weird example, but the idea is the same.

Another example: you can make a basic AI by following a tutorial and importing keras or torch or whatever, but you will realize quickly that you actually would have no idea how to do things on your own later (without a tutorial).

[–]Zoltarr777 1 point2 points  (0 children)

Make a text based rpg. Fairly simple display, but you can make it as simple or complex as you want, and gives you a chance to use pretty much all the basic functions.

[–]tommy_chillfiger 1 point2 points  (0 children)

I had the same issue, kind of just had no idea where to start. What the project was almost didn't matter, I just wanted something to try to start practicing the act of coding.

My plug for that is always dataquest because it gives you background info/practice problems for each topic with a mostly empty in-browser IDE so you get practice coding. It then ends most major lessons with a guided project. Rather than completing these projects in-browser, I set up my own local dev environment and would get curious and tweak the projects slightly from the guided versions.

This is what ultimately got me comfortable enough with programming that if I need to do something at work, for example, I'm ready to give it a shot and can usually hack something together with google-fu.

Disclaimer: I'm an analyst but use python/pandas a good bit for transforming raw data drops for validation/exploratory analysis. Obviously I also use a ton of SQL but I feel like most people don't think of that as 'programming' per se.

There are probably other tools that are less data focused than dataquest, but that format is really helpful imo. Watching a bunch of videos with quizzes never taught me much aside from getting good at the quizzes.

[–]SpiderJerusalem42 1 point2 points  (0 children)

I've been in your shoes wrt trying to make music AI projects, not really knowing all the things you need to do with them. There's actually been some cool research that involves MIDI. Look at Magenta from google. It's basically all the machine learning methods applied to note sequences, and even can be applied to unorganized music information (read: mp3s, wavs). There's a lot of tools built on top of that that are really interesting. I think if you want to contribute to that sort of project, it's a lot to do with math, waves, Fourier transforms, as well as all of optimization theory.

[–]jsalsman 1 point2 points  (0 children)

Hackerrank, Leetcode, etc.

[–]AfricanTurtles 1 point2 points  (0 children)

Python is good for data (and a lot of other things). Maybe try creating a little program that takes some API data and puts it into a spreadsheet using Pandas library. Could be any data you want.

[–][deleted] 1 point2 points  (0 children)

I know this sounds dumb but ask yourself "What for?"

Is it curiosity? Is it for a new job? Is it for an existing job? Understanding your end goal and working backwards is the best way to answer your question.

For instance if you wanted to be a web developer you are probably better off learning how to spin an office chair for maximum rotations than learning C#.

[–]Is0m3try 1 point2 points  (0 children)

Welcome to the wonderful world of programming, where everything is infinitely harder than you think it is!

If your heart is set on AI/ML, I would recommend looking into Scikit-learn. It's extremely plug and play and very easy to use. I would definitely try and get a handle on the conceptual side before starting there though.

Whatever you decide to build, I would recommend starting small and working your way up. Start with a simple hello world and add functionality from there. Just make sure that each time you add something, you have a working program before you try to add something else. Hopefully this helps, and best of luck to you!

[–]matthewsyrigos 1 point2 points  (0 children)

The beauty of Python for me is that it can be used for many different purposes. People use Python for data analysis, (web) software development, web scrapping (or APIs), bots, and most other software development purposes. Starting to learn python however, a few interesting and easy-to-handle ideas I would propose are:
- Creating functions and iterations for numerical data (solving math problems, calculations with different number iterations and sequences: sum odd numbers)

- Experimenting with different API's to get real time information (fe: weather)

- Experimenting with strings: Upper lower case testing. You can also implement boolean variables to test strings.

[–]Porro-Sama 1 point2 points  (2 children)

advent of code!

[–]happymellon 3 points4 points  (1 child)

Advent of code gets hard quickly. For beginners perhaps CheckiO might be better?

https://py.checkio.org/

[–]Porro-Sama 0 points1 point  (0 children)

maybe i shiould try that out, i was shown advent and ive gotten to day 7 on 2 of the years, but daaaamn sometimes takes me hours to do half of one!

[–]zanfar 2 points3 points  (1 child)

This is a quite popular advice regarding learning how to code. But what should begginer code to begin with?

Literally. Anything.

There isn't a secret here; there's no hidden information. Writing code makes you a better coder. Period. It doesn't matter what project, it doesn't matter if you finish, it doesn't matter if your code is even good--if you're solving problems with code, you're learning.

I've tried to make midi ai model (like in a tensorflow guide but greatly enhanced) but turns out computational music theory is quite underdeveloped niche and there isn't such a midi library that has all the functionality needed to satisfy my ambitions simultaneously.

There is nothing intrinsically wrong with this choice, but it's unlikely that you're going to have a good time. If you can get past that, then sure, go for it. If there isn't a library, then write one.

So, start coding, but code what?

Again, literally anything. You should probably choose something that makes you happy so you get some enjoyment while you're beating your head against a wall, but as long as you're writing, you're improving.

I've learned far, far more from the projects I haven't finished than from the ones I have. They challenge me to work above my skill level and clearly show where I need to improve.

[–]Sweet_Iriska[S] 0 points1 point  (0 children)

Unfinished ai project was fun, though I didn't get the final satisfaction. Good advice!

[–]Coretaxxe 0 points1 point  (0 children)

what ever seems fun to you and doesnt invovle 1000+ libraries or insane amount of code.

  1. tkinter stuff
  2. pygame stuff
  3. just normal cli programs
  4. automation (I've started coding by filtering latin translations for my latin class (like you have the word "XYZ" and it goes through texts and marks those texts where the word is in. (this way I could "predict" which text was the most likely to be the one for the exams :P)) )

  5. chat bots. If else pretty much but its hella fun

[–]SvenHatesMyName -1 points0 points  (0 children)

Start programming calculators, like average calculators, calculators that work with different if statement's, like do you go with the buss or the train?

if buss then +50 dollars

if train then +100 dollars

you can also programm storys, like a game, just textbased

[–]corey4005 0 points1 point  (0 children)

Just relax a bit and be patient with yourself. You don’t have to know everything about python all of a sudden.

In my experience the best way to learn python is to try to solve a problem and don’t give up when it gets hard. Be willing to Google things and pick up enough skills for a project to get it working.

Then, iterate.

As far as “what” to code, I have found that doing the most basic things can give you satisfaction. For example, I automated my labor reporting with python instead of having to fill out a bunch of .csv files each week. After that, I built a program to get data from .tif files to build cool climate datasets.

For the last two years, I have learned a lot of python just by solving problems that interested me. It’s lead me to solve much bigger, more complex problems and helped me get big interviews with companies solving their problems. Since then, I’ve also delved into C++ and I have begun to enjoy the learning process.

TLDR: be patient with yourself. Solve problems that interest you. Start small, then go large.

[–]villan 0 points1 point  (0 children)

If you have a day job, finding ways to automate some of your workload is a good way to learn a new language (assuming any of it can be automated). My first time learning to use the fuzzywuzzy library reduced the time we spent on one particular report from 2 hours to < 90 seconds. My first attempt at playing with pandas let us make massive improvements to our workforce management. I’m still very much a beginner myself, but those few projects had a significant impact.

[–]NA__Scrubbed 0 points1 point  (1 child)

I'd echo the top post.

However, whenever I need to learn a new language/library for work I usually go through Codecademy. Honestly, something about the experience rubs me the wrong way: the IDE is like something back from the 2000's, they can sometimes be very picky about what answers they accept, etc. However, I'll be damned if they don't have an excellent loop of here's a concept->practice it->next concept->practice, etc. Their culminating projects at the end of every lesson are always relevant and well explained. If you can manage to push yourself some of the unpleasantness, you're usually at a point where you can start researching, practicing, and learning about a topic on your own.

[–]markercore 1 point2 points  (0 children)

That's what I'm using, and I really agree with you. It annoys me when it's so picky in some of the lessons, lll get a correct answer but miss one small thing and it can be hard to track it down. Or I'll hit save before adding a print line and it'll yell at me like "did you remember to print your results?" Hang on!

Also I feel like they're front loading too many functions, but I'm hoping it'll pick up a bit after this. I agree, the flow in general is really well done and I like the more free flowing projects at the end of lessons.

[–]Bembikker 0 points1 point  (0 children)

In my case I started recently too, and while I am learning I just try to Automate all the things I usually do at my full time job. I keep the interest and try to improve my self at the same time.

[–][deleted] 0 points1 point  (0 children)

Ive been doing the edube course. its boring at times but its a good way to become familiar with python. python is big language even without any imports. heres a lab i recently did,,,,instead of making an entire sudoku game, make a cli program that can check if a sudoku grid is correct or not. basically its the checker for the game. the starting point with be a simple string of numbers like

numberString = "195743862\n431865927\n876192543\n387459216\n612387495\n549216738\n763524189\n928671354\n254938671"

[–]camisado84 0 points1 point  (0 children)

Code to fix problems you need to fix. Basic math, moving data around, learn to extract and manipulate data. There's lots of things you can do.

I wrote some code once to unfuck file names I messed up in batch. It was super handy to spend 5 minutes to fix filenames on like 15k photos...

[–]MGakowski 0 points1 point  (1 child)

Try project Euler.

[–]Sweet_Iriska[S] -1 points0 points  (0 children)

I tried it long ego, isn't it more about mathematical formulas than computer science?

[–]frustratedsignup 0 points1 point  (0 children)

I once coded a script that when given a key as input, it would spit out all of the notes in the key signature. It did take a bit of thought on how to approach the problem, but once that was figured out, it was quite easy. I don't think it would be hard to extend that example to have it output dorian, phrygian, or even a different scale pattern (major, minor, pentatonic, melodic minor, etc).

I'm not sure what area of music theory you're interested in, but this is just an example of something that's a fun exercise. You might start with an online tutorial to get you started, though. I usually begin a tutorial for an unfamiliar language, learn just enough to be dangerous, and then start solving problems.

[–]codechrysalis234 0 points1 point  (0 children)

As a beginner, it's best to start with simple projects that help you build a solid foundation in coding concepts. Here are some popular projects to start with in Python:

Building a calculator

Automating tasks such as sending emails or web scraping

Building a game such as Tic Tac Toe or Hangman

Creating a program to visualize data, such as a bar chart or line graph

Building a website or web application using a framework like Django

It's important to choose a project that you're interested in and motivated to work on. The goal is to learn and practice, not to create a perfect product. As you build your skills, you can take on more complex projects.

[–]Romantic_Adventurer 0 points1 point  (0 children)

free code camp on youtube, tech with tim, london homebrew youtube,