Skip to content

NinjaTyper/PythonLearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Fun

Let's learn Python together

pythonfun

How?

Goals

  • In 6 months, you will be to write automated tasks on your computer to do your "work" for you!
  • In a year, you will be able to write simple AI program that uses your webcam to recognize your pet vs you!

Big Project 1

Build a todo-app to keep track to things that you have to do! In life, very often that we will have things that we want or have to do, but we cannot do it at the moment, so we want to save it for later, and often enough we tend to forget! The less we forget, the more we will be seen as responsible person! Through the course of lessons here, we will continue to improve this big project to add more functionalities! Have fun!

Big Project 2

Create your trivia game where you can keep all the data in a JSON file.

Lesson 1

In the first Lesson, we are going to be focusing on setting up the python environment, and learn about the basic input and output.

Required Exercise for Lesson 1

  1. The program will ask the user to enter "your name". Then it will say back "Hello "
  2. The program will ask the user to enter a number, then it will print out a number that tripples that!
  3. You will design temperature converter between Celcius and Farenheit! That's it, be creative and have fun!
    • Hint: your program can simply ask for temperature in Farenheit, then out put the result in Celcius. But it could do more that just that 😉

Bonus Exercise (optional)

  1. You will design a currency converter program. Say you want to travel to Europe, and you want know how much your $100 USD is worth in € Euro, etc ...

Lesson 2

In Lesson 2, we will learn how to use the magic of python to solve some of the number problems that would have been difficult without the help of computers. eg. What is the next prime number after 1 million/1,000,000

Suggested material:

Required Exercise for Lesson 2

  1. The program will ask the user to enter a number, then it will print out all the number between 0 and that number.
  2. The program will ask the user to enter a number, then it will print out "even" or "odd" by checking that number.
  3. The program will ask the user to enter a number, then it will print out all the even number between 0 and that number.
  4. The program will ask the user to enter a number, then it will check to see if that is a prime number or not.
  5. The program will ask the user to enter a number, then it will print out all the prime number between 0 and that number.
  6. Design a useful calculator! It's entirely up to you to build this calculator as you see fit. It could be as simple as adding 2 number, or it could be more complex to let the user choose to do normal operation (+-*/) or do some some fancy operation like "2 to the power of 3" or "5 factorial". The sky is the limit!

Bonus Exercise (optional)

  1. Say you have a secrete number (between 0 and 1000) in your head or written down somewhere. Design a program to ask a series of question to find out what that number is. The user can only answer "yes" or "no" to the questions. Example questions:
  • "Is that number larger than 900?"
  • "Is it a 2-digit number?"
  • "Is the last digit number even?"
  • "Is the number 125?"

Lesson 3

In Lesson 3, we will learn about how strings work, how the text in coding works. You will learn about how to do string manipulation and have fun with it

Suggested material:

Required Exercise for Lesson 3

  1. Take in a string, then print out each character per line for each loop. Make sure to use 2 different FOR loops and one using WHILE loop! so yes, print out the whole thing 3 times!
  2. Experiment with ord(character) and chr(number)
  3. Take in a string, build a simple encryption of that string
  4. Now take in a encrypted string, then decrypt that string!
  5. Build a tool to use to encrypt and decrypt text messages! Remember that user experience is important, and be creative!

Bonus Exercise (optional)

  1. Build a encryption/decryption tool that has a concept of a public key and a private key!

Lesson 4

In Lesson 4, we will learn about how to store data in files, and read back and edit the files. This will help you store big projects into chunks, and each chunk will produce a data file.

Required Exercise for Lesson 4

  1. Make a yourname.txt that has your name in it, then read in that file and print to the screen.
  2. Write down every number from 1 to 100 to a file number.txt
  3. Write a program that read in number.txt and then add all the numbers up, and write the result into sum.txt
  4. Start the BIG PROJECT 1 above, with simple operation like: reading all the tasks from a file, provide option to add a task, remove a task or edit a task.
  • Say you have a tasks.txt (eat\n, sleep\n), your todo.py will read in the file and print out all the tasks.
  • Provide a menu:
    • Add a task
    • Remove a task
    • Edit a task
    • Mark a task as competed
    • Print completed tasks
    • Exit

Bonus Exercise (optional)

  1. Build a shopping experience! You can specify the list of items in a file (item name with price) , then read in the file data, then provide a shopping experience to the users.

Lesson 5

JSON time! We will learn about Dictionary data type and how to use it together with List, then how to store them in files as JSON.

Self-learn: https://www.programiz.com/python-programming/json

Required Exercise for Lesson 4

  1. Make students.json and students.py that reads in the data. Start out simple by having 2 students with just name.

  2. Add weight, and books (list) to students.json

  3. Upgrade your BIG PROJECT 1 (to-do-list app) to make use of JSON.

  4. Add clear screen functionality to improve your app's experience os.system('cls') (remember to import os)

  5. We will start on big project 2. Create your own trivia game!

Lesson 6

We will learn small things that can make your program better and more fun!

  1. Add sound
  2. Clear screen
  3. Make a turn-base Number Game.

Semester 2

About

People learning python together

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •