/LPTHW

Learn Python The Hard Way

Primary LanguagePython

Learn Python 3 The Hard Way

The project is created for learning Python 3 based on Learn Python The Hard Way by Zed A. Shaw.

Why I create this project?

Mainly for learning purpose. I will also write note for every exercise (if it is needed) in this README.

Getting Started

Prerequisites

You need to have

  1. Python3
  2. Code editor like: Atom

Installation

  1. Clone this project (Using gitcommand: git clone https://github.com/vietdang7/LPTHW.git or through your GitDesktop application)
  2. Install Python 3
  3. Install Atom

Testing

In your terminal:

  1. Move or cd to LPTHW (where you've just cloned the project)
  2. Move or cd to the exercise folder that you wanted
  3. Run python3 file_name.py. For example: python3 ex1.py Please note: all exercise files are in "Exercises" folder.

Exercise notes:

  1. Exercise 1:
    • To print new line, we can use print("\n")
    • In Python3, print is now a function
  2. Exercise 2:
    • Use # for commenting in Python
    • Read code backward to check errors manually
  3. Exercise 3:
    • Use math symbols and print in the same line with a string (seperate by a ",")
    • "%" is a modulus
  4. Exercise 4:
    • There will be space between string and variable when use print(). For example: print("There are",cars,"cars available.") -> There are 100 cars available. To avoid space, we can use concatenation + or print 'Value is "%d"' % value
  5. Exercise 5:
    • To format string and add variables inside, we will need to user print(f"string {variableName}")

Contribution

If you want to make contribution for this project, feel free to fork this project and make pull request. I grealty appreciate for your contribution.

License

  • Copyright of Learn Python The Hard Way is belong to Zed A. Shaw.
  • This project is licensed under the MIT license