Python Bootcamp
Python Bootcamp
Course FAQs:
Note: Many of these FAQs pertain to Notebooks, Anaconda, and Python. All of which we will discuss in
Section 2 with video content. We have videos going over all about Python and the installation process.
This FAQ is just here as a reference for you to visit whenever you wish. If you want to continue with the
course and the install procedure, continue on to the next lecture. Thanks!
1. Where can I find the Jupyter Notebooks for the Course? The course is now in Python 3, but still have
the older Python 2 notebooks available for reference in case you need them.
https://github.com/Pierian-Data/Complete-Python-3-Bootcamp
https://github.com/jmportilla/Complete-Python-Bootcamp
2. How do I download the Notebooks? (We show this in a video in the next section)
You can go to the GitHub page linked above and then click the download zip button to download all the
notebook (.ipynb) files onto your computer (compressed as a zip file, you'll need to unzip it). Check out
the lecture "Getting the Notebooks" for a video guide to this.
To find out where your notebooks are type: pwd in a cell and run it with Shift+Enter. This will print your
working directory.
You will need to change the directory in which you are starting you jupyter notebook. Use cd in the
terminal or command prompt to change to your desired directory if you are running jupyter notebook at
your command line. Alternatively, just navigate to your desired directory using the Anaconda Navigator
as described in the lecture "Running Python Code".
5. How do I open .ipynb files? What program do I choose? (We show this in a video in the next section)
After installing Anaconda, search your computer for Anaconda Navigator, then launch jupyter notebook
and move through the Jupyter Notebook interface until you reach your desired directory where you have
your .ipynb files. Please note, you cannot just double click a .ipynb file, it won't open that way.
Using Juptyer Notebook at your command line? Here are the instructions to open .ipynb files through
your command line:
In order to open the Notebook Files, you'll need to have Python and the Jupyter Notebook system
installed, check out the Python Set-up section for more details on the installation of Python and the
Jupyter Notebook system (or you can just follow the relevant instructions here if you feel more
technical). Once you have python and the jupyter notebooks installed you are ready to open the
notebooks using the following steps:
First open up your Command Prompt (search for cmd on a Windows machine) or if you are on a Mac use
your terminal (Spotlight search for terminal).
Next in you terminal/command prompt type pwd and press enter (this will print your working directory)
Take note of what file directory was displayed, this is where you should save your .ipynb files (or a folder
containing your .ipynb files)
Once your ipynb files or folder containing the files is in the location displayed from the pwd step go back
to your terminal and type jupyter notebook and press Enter.
After Step 4 you should have a browser tab open up with the Jupyter Notebook system running inside of
it.
Click on your Notebook (or go to your folder of Notebooks) displayed in the Jupyter Notbeook and it will
open in a new tab with the Notebook you selected.
Check out Udemy's official link on this (we don't control certification).
https://support.udemy.com/hc/en-us/articles/229603868-Certificate-of-Completion
https://drive.google.com/drive/folders/1CKqOQzst1cGURXGiRVivi2Xsc0n-X8CR?usp=sharing
Since we are still in the beginner phase of learning Python, it is recommended to launch Anaconda
Navigator since it’s a graphical user interface (GUI) of the various development environments that comes
with Anaconda.
Ex. 2+3
Then select the run command or select ‘Cell’ from the Menu Bar, then select ‘Run Cells’. You can also use
the keyboard shortcut ‘ctrl + Enter’ to run the operation or code.
For additional information regarding Jupyter Notebook, you can select ‘Help’ in the Menu bar and then
select ‘User Interface Tour’
To close the Notebook, simply exit out of the tab in your browser, and to completely close out the
Notebook, select the ticker right beside the recently closed notebook and click on ‘Shutdown’
To delete a notebook, select the ticker beside the notebook you want to delete and then select the trash
icon
Similarly, you can delete a folder by doing the same as above but please note that you cannot delete a
folder with a content in it. It is a safety feature of Python that prevents you from accidentally deleting an
entire folder with content still in it.
No Install options for Python (Browser Based)
jupyter.org/try
Google Collab Online Notebooks (Google account required)
Repl.it
You can also Google “Python Interpreter Online” for available options
Why not just run Python in the No Install option above? It could be hard to upload your own code.
Saving your code could also be an issue since some of the No Install options requires you to pay before
proceeding to save your file.
For text editors, you can use sublime text editor, which is free to try forever, it just has pop-ups asking
you to upgrade every once in a while
To run your python code in CLI (Command Line Interface), type ‘python <filename>
Or you could also develop your code in CMD or the CLI of your OS by simply typing ‘python’ and it will
open Python for you in your CLI
To quit out of the environment, type: quit () and you will return to the previous directory where you
were at before running Python.
.ipynb stand for ‘I python notebook file’, NOTE: these files cannot be opened by default in your OS, it has
to be opened through Jupyter Notebook system.
Notebook uses a cell based system where the Notebook will auto correct any syntax error with each line
of code you type in.
If you want to put in notes into your code, you can select ‘Markdown’ from the drop down selection
where you would normally see ‘Code’ in your notebook. Once you select that, you will just be typing in
regular text and your notebook will not interpret it as part of your code.
What is Git? Git is an online open-source distributed version control system designed to handle
everything from small to very large projects with speed and efficiency.
Git is easy to learn and has a tiny footprint with lighting fast performance. It outclasses SCM tools like
Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging
areas, and multiple workflows.
What is GitHub? It is an online repository and where you can publish your repos of your own and
collaborate with the community.
Can you use GitHub without Git? Of course, these are separate environments that you can run apart
from each other
% - mod function, used to check if a value has a remainder and will display it as its output
Ex.
** - Exponential value. It takes the first number followed by the operator ** and then raises it to the
power of the 2nd number. Ex.
Python follows MDAS when you assign multiple mathematical operators, so keep in mind that you have
to put parentheses when you want an operation to go first when running your code.
If you assign a variable a value and use that variable in an operation, it will take the current value of that
variable and then keep repeating the operation with the current value.
Ex. If you assign the variable ‘a’ with 10: a = 10, then follow your line of code with a = a + a, then it will
take the current value of 10, then add then which will output as 10, but keep in mind that if you run it
again, the current value of ‘a’ is 20, so the next output with be 40 and so on.
Use the data type: ‘type’ to check the current data type assigned to a variable
Lesson 6: Strings
You can use either single or double quotes to indicate a string, but if you’re going to use words that
already have a single quote like “don’t”, you should use double string to prevent Python from
prematurely closing out that string.
Use the print function to display “hello”
You can add escape sequence in Python. Ex. \n adds a new line \t for tab
You can also run a ‘step size’ to display characters at specific intervals as shown below. Please take note
of the syntax as well where the step size is triggered by two colons:
Lesson 6: String Properties and Methods
Strings are immutable, meaning they cannot be changed once it has been assigned to a variable
Ex.
The only way to modify an existing string is to concatenate it using this syntax: <variable name> + ‘<your
edit to string>’
If you need to omit something from the existing string, you have to assign a new variable to that string
and just use indexing to extract the characters needed for the new string.
You can also use the multiplication operator to repeat the same string by x
Ex.
You can call out attributes or methods in a string variable by typing in the variable/string then add the
dot sign and press tab to show the drop down of all the attributes or methods available to the string
object.
Ex.
Keep in mind that the attribute/method doesn’t change the original string assigned to the variable. Also,
make sure to add the open and close parenthesis at the end of the syntax to execute the
attribute/method.
Ex.