What simple python programs can I write with basic python knowledge? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 20

What simple python programs can I write with basic python knowledge?

13th Jun 2017, 10:13 AM
David Ajuka
David Ajuka - avatar
36 Answers
+ 19
Guess the number, which starts off easy but you can expand the game to track number of guesses, quickest time, least number of goes maybe build a leaderboard. This helps your understanding variables, while loops, input and output, data validation (what if user enters a string instead of a number) maybe even file functions. It's a simple program but a great exercise.
13th Jun 2017, 12:45 PM
andyt
+ 15
Create a calculator, it's actually very simple. It combines all the fundamentals, such as variables, functions, loops, conditions, lists, etc. A physical calculator is something most of humanity takes for granted, and creating a program version of it is a good starting point for any and all programmers. You don't need to do anything fancy, just simple user input (ex: 1 + 2) and the program should return the answer on the console for the user.
13th Jun 2017, 5:03 PM
Sapphire
+ 9
What does a Raspberry Pi have to with writing Python code "that is actually useful" when Python code is everywhere, on every platform and used in many games for scripting? I'd say Python code is pretty useful without a Raspberry Pi, considering it was around long before they came out. It's certainly very useful on a GNU/Linux system.
14th Jun 2017, 11:58 AM
Jamie
Jamie - avatar
+ 8
I used to teach Python and I created this two-part presentation with lots of explanations and exercises, I think it's a good starting point! By the end of it, you can create some simple, quite cool programs to run on the terminal :) Part 1: https://www.slideshare.net/silviacat/introduction-to-python-part-12 Part 2: https://www.slideshare.net/silviacat/introduction-to-python-2-part-22 Enjoy coding :)
15th Jun 2017, 1:38 PM
silvia
+ 7
when you say basics I am assuming you have not done OOP yet so how about you try creating functions to do math algorithms like length of a line, area of triangle, unit conversions, prime numbers and statistics like mean, median,mode.
14th Jun 2017, 11:40 AM
Kevin Oudai
Kevin Oudai - avatar
+ 6
You would need to make some OS-specific calls to make a keylogger in Python AFAIK. Anyway, we're talking simple here, OP asked for basics.
14th Jun 2017, 10:20 PM
Jamie
Jamie - avatar
+ 6
an age calculator is a decently basic piece of code. You can add different ways to calculate the age, either in seconds, minutes, hours, days, etc. or try having it return all options of the persons age. I think it can help to build a logical thinking too depending on how you write it.
15th Jun 2017, 3:11 AM
Dustin Hammack
Dustin Hammack - avatar
+ 6
depends on your project needed.
15th Jun 2017, 7:57 PM
mohammed al-sarem
mohammed al-sarem - avatar
+ 5
u can make a keylogger with python if u have interest in hacking
14th Jun 2017, 4:31 PM
Devanshu Rawat
Devanshu Rawat - avatar
+ 5
Check this website it gives you ideas: www.hackerrank.com
18th Jun 2017, 4:02 AM
keivan Ipchi
keivan Ipchi - avatar
+ 4
Quiz application with questions randomly picked from prepared text file?
15th Jun 2017, 8:59 AM
Kacper Cybuch
Kacper Cybuch - avatar
+ 4
You are only limited by your imagination,python is powerful.
21st Jun 2017, 5:58 AM
Haris
Haris - avatar
+ 3
Not to advertise my own code, but games like this (run with QPython or on PC, it doesn't run on SL's crappy emulator). It's a puzzle game using text-based graphics: https://code.sololearn.com/czaQlg5dZoU7/?ref=app
14th Jun 2017, 12:23 AM
Jamie
Jamie - avatar
+ 3
simple calculator
15th Jun 2017, 4:19 AM
Laksono Bramantio
+ 3
A simple calculator program is good for a start. Since that'll you more insights on using the OOP concepts and defining and using of methods etc. Well, if you're interested in more projects, you're more than welcome to visit my blog for Python mini projects and Kotlin tutorials. https://technopediabuzz.blogspot.in/?m=1 Thank you. :) :D Stay motivated; keep Coding! :D
15th Jun 2017, 9:11 AM
G P
G P - avatar
+ 2
depends on the language your code is in, as to how to to convert to application
15th Jun 2017, 4:36 PM
Dustin Hammack
Dustin Hammack - avatar
+ 2
for one, do you mean gui (graphical user interface) applications with buttons and drop down menus. because anything you write with any programming language can technically be an application
15th Jun 2017, 10:37 PM
Dustin Hammack
Dustin Hammack - avatar
+ 2
different types of calculators. whether that be a gas mileage calculator, tip calculator, bmi calc etc... they all share the same concept which is take user input and do some math with that input to give the user an output(ex take miles driven, the average price of gas, and their mpg to output the price for a trip)
16th Jun 2017, 12:24 AM
Xero
Xero - avatar
+ 2
A calculator?
18th Jun 2017, 6:29 PM
Iwan
Iwan - avatar
+ 2
String manipulation is also a fun way to start. Something like this not only teaches you the basics of strings, but also if statements, loops and possibly recurssion: https://code.sololearn.com/c97qjzDoYLDL/?ref=app https://code.sololearn.com/cPu9v9lmPfN1/?ref=app
20th Jun 2017, 8:43 PM
Agnius Bartninkas
Agnius Bartninkas - avatar