Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: Python Detailed Notes {With Codes}
Description: This PDF contains Detailed Notes to help you with your python programming journey. I have made these notes with utmost care and free of errors. I have also included all the codes which you can straight away copy and paste. Best of luck for your coding journey!!
Description: This PDF contains Detailed Notes to help you with your python programming journey. I have made these notes with utmost care and free of errors. I have also included all the codes which you can straight away copy and paste. Best of luck for your coding journey!!
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Introduction to Python
Python is a programming language that computers can
understand
...
It is also a great
tool for machine learning and data science
...
The latest version as of now is 3
...
5, but you can use
the version specific to your computer
...
After downloading, simply press continue,
agree, and install
...
On Mac, it does it for you automatically
...
The software that
allows you to use Python code is easy to install
...
The installer is quick and easy
...
You can download and install the code
editor from the official website
...
It is a necessary tool for writing Python code, as it allows
us to use code in any programming language
...
The installation process for VS Code is straightforward
...
On a
Mac computer, it is most likely in the downloads folder
...
To download VS Code for a Mac computer, click on the "Mac" button
and then click "Download"
...
Create Your First Python Project
Introduction
Let's install a plugin for Python in VS Code, which allows us to work with
various languages
...
In step three, open or create a Python file and start coding
...
This plugin has 26
million downloads and many features for working with Python
...
Once we install the
plugin, we can create a new tool with ease
...
py
...
Writing Python Code
To write Python code, we need to start coding in a Python file
...
Zooming In
Press the green button to make the screen full and press command plus
to zoom in to see everything we're doing
...
Write the code in a Python file and execute it
...
This is a common program for beginners to learn
...
print("Hello World")
Now, let's modify the program to ask for the user's name and then print
"Hello" with their name
...
We'll then print
"Hello" and their name using the print() function
...
Then, type the command
"python filename
...
You should see the program output "Hello" followed by the
user's name
...
py" and entering a new name when prompted
...
Here, we have a variable named name , which equals "Jamila," and a
second variable named surname , which equals "Smith
...
Strings are important in
programming, and I will cover methods later on
...
We can do many things with strings
...
We have a list of methods that we can use with strings
...
We can test our knowledge of a
string's methods by using a string
...
We use them frequently and
are confident in our abilities
...
The capitalize method can be used to capitalize the first letter of a
string
...
For example, if we write:
name = "Jamila"surname =
"Smith"print(name
...
capitalize())
We will get the output "Jamila Smith
...
For example, if we write:
print(name
...
"
If we write:
print(name
...
"
Working with Numbers
Working with Numbers in Python
Python's Python program allows you to work with numbers and perform
arithmetic operations on them
...
•
Addition: 10 + 5 = 15
•
Subtraction: 10 - 5 = 5
•
Multiplication: 10 * 5 = 50
•
Division: 10 / 5 = 2
...
For example, 10 mod 5 = 0 (because 5 goes into
10 two times with no remainder)
...
org or other sources such as python
...
rs, or pypy
...
So, 4 + 4 = 8 and 8 + 2 = 10
...
These expressions are used when you need to know whether an
expression is either true or false
...
For example, you can create expressions like:
•
is_adult = true
•
is_teenager = false
Here are some examples of boolean expressions:
•
10 <= 10 (true)
•
0 == 1 (false)
•
jamila
...
Boolean expressions give us the boolean data type, which represents
true or false values
...
Booleans
are used to make decisions when writing code
...
Otherwise, if it's false, we won't print
anything
...
One thing to bear in
mind is that we're printing isAdult here
...
If it's true, we'll
print line 4
...
If this is false, this line
will not get executed, but the else will be
...
If I change it to, for example, 17, you can be sure
we have "not an adult
...
But if this expression is
true, this will be skipped, and the else will be executed
...
If age equals 18, we're sure we are
not an adult
...
Here, you can see that
it's very important that you indent
...
e
...
If you don't indent correctly, you'll get an
indentation error
...
if isAdult:
age = 18
if age < 18:
print('not an adult')
This is how you work with if statements and Booleans
...
To access the first element of a list, we use an index which
starts from zero
...
For example, in the list of cars, we would use cars[0] to
access the first item
...
The
last position of the list can be accessed using the index -1
...
The index starts with zero, and the numbering system always starts with
the number of items
...
If we try to access an index that does not exist, we will get an error
...
To add another item to the list, we can simply use the append method
...
append("Toyota")
...
append("Toyota")
print(cars[3]) # Output: Toyota
Python Loops
Loops allow us to execute any piece of code automatically by looping through
the list
...
As soon as it becomes false, the loop terminates
...
To do this, we can use
the while loop and end it with a colon
...
However, we need to be careful because if we don't increment the value
of "number", the loop will run forever
...
To fix this, we need to increment the value of "number" inside the loop
...
This will increment the value of "number" by 1 each time the loop
runs
...
Value of
number is " + str(number))
When the value of "number" becomes greater than 10, the loop will
terminate and the program will print "While loop ended
...
That's how you use the while loop in Python
...
Python Functions
Functions in Python
A function is a piece of code that is executed only when called
...
To invoke a function,
we can use its name followed by parentheses containing any
parameters
...
To avoid this, we should place the function invocation after its
definition
...
For
example:
def check_age(age):
Within the function, we can use conditional statements to perform
actions based on the parameter
...
To create a class in Python, simply type "class" followed by a
name
...
Let's create a class that
resembles a person and then create two different people:
class Person:
def __init__(self, name, age):
self
...
age = agejohn =
Person("John", 22)marriam = Person("Marriam",
21)print(john
...
age)print(marriam
...
age)
Behaviors are functions
...
name = name
speak(self):
self
...
age = age
def
print("Hello, my name is",
def walk(self):
print(self
...
speak()john
...
speak()marriam
...
If I run this and yet again I forgot to add the string conversion
on integer so it is fine
...
Let's run it one
more time and there's we have a space here so I am 22 years old and then John
walks so John is walking and then we have Mariam so Mariam 18 and these
here are the actual behaviors
...
"
•
Miriam is walking
...
There you
have to add a space to the print statement and there we have
...
Let's start by creating variables to hold the name, phone
number, and email
...
add_paragraph("Hello")
We can see that it works when we run it and open the document
...
We can also add a name, phone number, and email at the bottom of the
CV
...
add_paragraph("Name")
To add the phone number and email, replace "Name" with "Phone
number" and "What is your email?", respectively
...
Finally, we can add a photo to make it more appealing
...
My name is [insert name here] and you can
reach me at hello@amigoscode
...
My address is [insert address
here]
...
First, we'll store this paragraph in a variable called "p
...
Next, we're going to add some work experience to our CV
...
We'll also add a header to
the paragraph for clarity
...
We can customize the headers and job descriptions to fit our specific
experiences
...
We can use the same techniques we used for adding work experiences to add this
information as well
...
To obtain the user's response, we will convert it to
lowercase
...
To break out of the
loop, we will check if the answer is not "yes"
...
If it is, we will continue asking the same question
...
Code:
while True:
answer = input("Do you have
more experiences? ")
"yes":
CV
break
if answer
...
")
Experience Description
When adding experiences to the CV, we need to be specific
...
The format for experience details should be:
•
Company name
•
Position held
•
Dates of employment
For example:
Company: Intuit Quickbooks
Media Expert
Position: Social
Dates: 2019 - Present
Code:
while True:
answer = input("Do you have
more experiences? ")
if answer
...
")
Once we have all the experience details, we can add them to the CV
...
If the user wants to
add more experiences later, they can run the program again
...
lower()
company = input("Company
position = input("Position held: ")
dates = input("Dates of employment: ")
experience = f"{company}\n{position}\n{dates}\n\n"
cv += experience
your experiences
...
Build a section where you can showcase a
list of your skills
...
•
Then, set up a while loop
...
•
To display the skills in bullet points, use the following code:
while (userInput !== 'no more skills') {
skills
...
createElement('ul');skills
...
createElement('li');
listItem
...
appendChild(listItem);});document
...
appendChi
ld(skillsList);
Once you've built the section, add a footer to your document
...
querySelector('footer');footer
...
';
Finally, add a page to your document:
const newPage =
document
...
textContent = 'This
is the solution page
...
body
...
Conversion of Text to Speech
To use the library to convert any text to speech, install it first
...
You will see a question prompting you to input your name
and how you are feeling
...
For example, you can ask "Hello Ebba, how are we today?"
Invoking the Function
You can invoke the function by saying "hello" and then wrap it with
the speak() function
...
For
example, you can say "What's my name?" and it will respond with a
question mark
...
Using the Program
To use the program, you will need to input your name and answer the
program's questions
...
Adding Functionality
You can add functionality such as phone numbers and email addresses
by creating separate functions
...
Conclusion
The Text to Speech library is an amazing package that can be used for a
variety of programming tasks
...
Python requirements
...
txt"
that lists all the necessary packages for the application
...
This ensures that anyone who receives the project
can easily install the necessary packages with just one command
...
To solve this,
simply run the command to download the necessary libraries into the project
and the program should run without issue
...
8
...
9
...
Testing the application on play
requires inputting your name and phone number
...
Build Python Portfolio with Github
Creating Your First Portfolio
Congratulations on completing this application! It's time to create your
very first portfolio to showcase your work to potential employers
...
1
...
2
...
3
...
txt
...
Commit the changes and create the repository
...
Click on "Projects" and then click on the pencil icon to add your
work and share it with others
...
Join the Amigos Code community on Facebook, Discord, and
...
Check out Amigos Code's other courses on Python
...
Fill out the Google form to participate in the Q&A session in
December
...
Good luck on your coding journey!
Title: Python Detailed Notes {With Codes}
Description: This PDF contains Detailed Notes to help you with your python programming journey. I have made these notes with utmost care and free of errors. I have also included all the codes which you can straight away copy and paste. Best of luck for your coding journey!!
Description: This PDF contains Detailed Notes to help you with your python programming journey. I have made these notes with utmost care and free of errors. I have also included all the codes which you can straight away copy and paste. Best of luck for your coding journey!!