8000 GitHub - jdoshi110/python-basics-exercises at db40af7fe3371988f6b333a9df364de8d6064a74
[go: up one dir, main page]

Skip to content

jdoshi110/python-basics-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exercises for Real Python's "Python Basics: A Practical Introduction to Python 3" Book

Downloading the Files

With git

If you have git installed, the easiest way to access these files is to clone the repository to the directory of your choice:

$ git clone https://github.com/realpython/python-basics-exercises.git

Then cd into the itertools-in-python3 directory:

$ cd materials/itertools-in-python3

Without git

Alternatively, you can download the entire repository as a .zip file from the repository's homepage using the green "Clone or download" button in the top right hand corner.

Download repo as zip

Running the Code Examples

To run the code examples, first make sure you have Python 3 installed on your machine. The code examples WILL NOT work with Python 2. If you need help installing Python 3, check out Real Python's Python 3 Installation & Setup Guide.

To run the sp500.py file, type python3 sp500.py into your terminal. Here's how that looks, with output:

$ python3 sp500.py
Max gain: 11.58% on 2008-10-13
Max loss: -20.47% on 1987-10-19
Longest growth streak: 14 days (1971-03-26 to 1971-04-15)

Note: Depending on your installation, you may need to type python3.6 or python36 to run the examples. If you follow the Python 3 Installation & Setup Guide, you should have no problem.

Similarly, for swimmers.py:

$ python3 swimmers.py
Backstroke A: Sophia, Grace, Penelope, Addison
Backstroke B: Elizabeth, Audrey, Emily, Aria
Breaststroke A: Samantha, Avery, Layla, Zoe
Breaststroke B: Lillian, Aria, Ava, Alexa
Butterfly A: Audrey, Leah, Layla, Samantha
Butterfly B: Alexa, Zoey, Emma, Madison
Freestyle A: Aubrey, Emma, Olivia, Evelyn
Freestyle B: Elizabeth, Zoe, Addison, Madison

TODO: Adapt for Python Basics

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0