Python Fundamental Class
- Description
- Curriculum
- FAQ
- Reviews
Welcome to Python Crash Course! In this course we will learn about python fundamental and object oriented programming (python). Let’s discuss why you will learn python and why this course will best for you?
PYTHON is one of the most popular languages for present-time and future also. Python is very beginner- friendly language. If you have no idea about any programming languages, Python will be the best option to start. Python is called multi-purpose language for its use. People use it in every sector. Its syntax is very easy than other programming language and easy to learn. People use python in
• Web Development
• Game Development
• Software Development
• Ethical Hacking and Cyber Security
• Machine Learning and Artificial Intelligence
• Data Science and Data Visualization
• Web Scraping Applications
• CAD Applications
• Embedded Applications
But the good news is python is one of the easiest programming languages in world. It is mostly similar to English and very easy to learn. So the future programmers! I hope we all are ready to jump in the world of programming!
What you will Learn.
• You will get every video’s lecture sheet! So, no way to miss a single part of course.
• Explained every part very friendly and provided extra resources for practice.
• Provided source code of every part.
So, let’s start a happy journey with The Apps Firm! We will see in next video!
-
12. Programmer Fundamental IVideo lesson
Programmer Fundamental (1)
Welcome to Python Crash Course! In this class, we will basically start the python fundamental. Mainly python use interpreter to run its code. But today we will use online interpreter to run our code. Our goal is at first; we will learn the syntax and practice a lot and lot. We don’t need to memorize A to Z of python dictionary.
But, we have to learn and make a practice to search in the google. Every programmer should be a well searcher, because it is not possible to remember every single part of any programming language. The master programmers also a good searcher and a perfect combination of best practice and research.
When we will learn a part of our programming language PYTHON, at first we have to practice the showed part and then we search the topic and make a research. Then we will practice a lot! Best wishes…
We will learn fundamental by following this method:
For the very beginning, a beginner needs to learn the data types of the language and then the action. So, at first we learn the Data types of Python and then the Action.
-
23. Data type ExplanationsVideo lesson
Python Data types
Ok, at first we have to know what data type is. Mainly Data types are the classification or categorization of data items of a programming language. It mainly shows us what kind of value that tells what operations can be performed on a particular data.
Now we will learn the list of data types in PYTHON. It has much type of data types. We will learn them step by step. Let’s get started:
· Fundamental Data Types:
1) int
2) float
3) bool
4) str
5) list
6) tuple
7) set
8) dict
· Classes -> Custom Data Types:
There are many pre-defined data types in Python. And, we can create our own custom data types.
· Specialized Data Types:
Python has a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, double-ended queues, and enumerations.
When we take these data from user or when we need to process these data, we need to store it in something. Mainly, in real life we store the materials in many containers, such we have container in programming languages. Yes, We have container named variable. At first, we will learn about the container, which is named by variable then we learn the data type. I will see in next video.
-
34.VariableVideo lesson
Variable
Ok, we already know that variable is the container of programming language, where we store the data for processing. If we want to store any material, we need container. That’s like if we want to store any data, we need variable.
The syntax of variable in python is:
x = 5
y = “John”
In here, x and y is the name of variable. We should rename every variable. But we should keep some instructions in mind when we rename variable. Those are:
A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume). Rules for Python variables:
A variable name must start with a letter or the underscore character
A variable name cannot start with a number
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
(Resource: www.w3schools.com)
We should use (‘’/ “”) , while we store string type data in a variable.
Python allows you to assign values to multiple variables in one line:
Example: x, y, z = "Orange", "Banana", "Cherry"
And you can assign the same value to multiple variables in one line:
x = y = z = "Orange"
We can add same types variable by (+). We can add int+int/ string+string.
We can reassign the value to a variable. Like, once I set a value of a variable, we can re-assign value to that variable and then the value of that variable overwritten. Example:
a = 4;
a = 9;
Here, if we print the value of a, it will show us the value of a is 9.
For print any data in python, we have to use print() function in python.
-
45. Operator PrecedenceVideo lesson
Operator Precedence
Operators are special symbols in Python that carry out arithmetic or logical computation. The value that the operator operates on is called the operand.
But before that, we have to learn a function. If we want to show any data types, we have to use a function. In python, it is print().
Many types of operators are used in python. Let’s have a discuss on that:
1) Arithmetic Operator: + (Add), - (Subtract), * (multiply), / (divide), % (Modulus), // (Divide and make a floor number), ** (Exponent)
2) Comparison Operator: > (Greater than), < (Lower than), == (If equal), (!=) Not Equal, >= (Greater or Equal than), <= (Lower or Equal than).
3) Assignment Operator: +=, -=, *= etc.
4) Logical Operator: and, or, not
5) Identity Operator: is, is not
6) Membership Operator: in, not in
Precedence of Arithmetic Operator:
()
**
*, /
+ , -
-
56.StringVideo lesson
String
String is one type of data type which contains the word and sentence. In this class we will know details about string.
At first, I would like to show you an example.
ab = 199
bc = ab/11
Here, ab/11 part is the expression and the full sentence is statement.
If you want to many lines in a variable, you can use long string. For that you have to use (‘’’ ‘’’) instead of (“”).
Example: my_var = ‘’’ this is my
First long string. It is so much fun! ‘’’
In many places you need to use same type of data. Like all strings or all integers. In here, Type conversion is a very important topic. We can convert any data types to string by str() function and to integer by int() function.
We can check their data type by type() function.
There are some Escape Sequence: t = make a tab, n = new line, = string .
String index and Slicing:
Every letter has an index number. It’s start with 0.
Example: “Apps Firm”
0123456789
We can print individually index’s value. Or we can print 0-2 or 0-5. We can see the syntax from an example:
exam = ‘564552445’
print(exam[0:5:1])
Here, the format is [start:stop:stepover]
Start means from which index I want to start. And stop means in which index I will stop print. And stepover means how many numbers I will step over.
The value of a string variable is immutable. What does mean by immutable? You cannot change a single index’s value. You have to change the whole variable’s all of the index’s value. But you can add a value, but can’t change.
-
68.ListVideo lesson
List
List is the one of most used data type of python. If we need to store more than one data material in one variable, we should use list. We can store multiple items together by list. All material is not necessary to be same type.
Let’s see the syntax of list:
a = [3, 2.5, 'python-list']
List also maintain by index. We already know the concept in string section. It has also the index number and it starts with 0. We can print individually index’s value. Or we can print 0-2 or 0-5. We can see the syntax from an example:
exam = [3, 2.5, 'python-list'];
print(exam[0:5])
Here, the format is [start:stop]
Start means from which index I want to start. And stop means in which index I will stop print.
The value of a list is mutable. What does mean by mutable? You can change a single index’s value.
We can copy the entire list and put into a different variable. How to do that? Let’s see an example.
new_exam = exam[:]
That’s all we discussed till now is about single dimensional list. Now we will talk about multi-dimensional list.
Let’s recognize multi-dimensional list by an example.
Mult_dimen = [
[1,2,3],
[4,5,6],
[7,8,9]
]
A list in another list call multi-dimensional list. We can set a list in another list, and that in another list. By this, computer has completed difficult tasks.
How do we print that?
We can print 4,5,6 by print(Multi_dimen[0][1])
Ok, I hope till now all of you understand the all of the part.
-
77.Programmers Fundamental 2Video lesson
Programmer’s Fundamental - 2
At first let’s talk about Boolean data type.
In every programing language, we will find the Boolean data types as “true/false”. We can set many condition like if that true, then do it or if that is false, then do that.
Then we have to talk another build in function. We will learn the input() function. By this function we can take any input from the user. Let’s see the syntax:
print('Enter your name:')
ab = input()
print('Hello, ' + ab)All of we want to be a big programmer. So we have to practice the best, follow the best practices. We have to read other people’s code and other persons will read our code. We have to write code in that way, as other programmer can read and understand it very easily. This characteristic of anyone’s code is called readability. A pro programmer always code in that way, which is easily understandable.
We can use comment to make a code more understandable. We can use 2 types of comment. Once is for one line, and another one is for multiple line.
For one line:
#It is a one line comment
For multiple line comment:
“”” This a multiple
Line
Comment “””
-
89. Tuple,SetVideo lesson
Tuple
A tuple is a collection which is ordered and unchangeable. In Python tuples are written with round brackets. It also maintains the index system. We already learned a lot about indexing.
Let’s see the syntax of tuple:
tup = ("apple", "banana", "cherry")
print(tup)It’s index system as usual as list. So, if anyone can learn one index system, he can perform all. Python tuples are immutable.
Set
A set is a collection which is unordered and unindexed. In Python, sets are written with curly brackets. It has no indexing system. Let’s see a syntax of set:
thisset = {"apple", "banana", "cherry"}
for x in thisset:
print(x) -
910.DictionaryVideo lesson
Dictionary
Dictionary is an unordered collection of key-value pairs. It is another most important part of python. It is generally used when we have a huge amount of data and we want to set by its own key or index. Dictionaries are optimized for retrieving data. We must know the key to retrieve the value.
Let’s see the syntax of dictionary.
thisdict = {
"name": "Benn",
"age": 30,
"b_year": 1964
}
print(thisdict)In Python, dictionaries are defined within braces {} with each item being a pair in the form key:value. Key and value can be of any type of data.
We can access its item by referring its key name. Let’s see an example:
print(thisdict[“age”])
Dictionaries are mutable. Anyone can add any data to a dictionary. Lets see how to add an item in dictionary.
thisdict[cgpa] = 3.85
-
1011. if elseVideo lesson
Conditions
Ok, let’s start another important topic of python. Computer is a brainless thing we know that. So, if we want to do something by computer, we have to instruct it. In instruction, sometime we need to put some condition like if anything is true then do that, else do that. In programming languages also have this type of terms. So we will learn now conditional statements and structures now and it will be great fun!
Python supports the usual logical conditions from mathematics:
Equals: var1 == var2
Not Equals: a != b
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
These conditions can be used in several ways, most commonly in "if statements" and loops.
An "if statement" is written by using the if keyword. Decision making is required when we want to execute a code only if a certain condition is satisfied.
The if, elif, else statement is used in Python for decision making.
a = 33
b = 200
if b > a:
print("b is greater than a")Sometime only if and else will not satisfied our terms. Sometimes we have to use more than 2 condition for a variable. Like, if anything is true, then do that For that, or another thing is true than do that, or another thing is true, than do that else do that. we will use elif. Elif means if the previous conditions were not true, then try this condition. Let’s see an example of elif and else.
a = 33
b = 33
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")else:
print(“Result unknown”)
Use of and, or in conditions:
Sometime we need to merge conditions. Like if this and those correct, then do that. Or, if this or that correct, than do that. That time we use and , or. Lets see some example:
a = 200
b = 33
c = 500
if a > b and c > a:
print("Both conditions are True")a = 200
b = 33
c = 500
if a > b or a > c:
print("At least one of the conditions is True")When we use and, then the condition will be true if both expression become true. When we use or, the condition will be true when one of two condition will be true.
Nested if else:
Sometime we need to put conditions in condition. This is called nested conditions/ nested if else. Let’s see an example:
x = 41
if x > 10:
print("Above ten,")
if x > 20:
print("and also above 20!")
else:
print("but not above 20.") -
1112.LoopsVideo lesson
Loops
Sometimes we need to iterate our data. Think, we have a tuple or sets. Now we need to show all of data uniquely and automatically. For that, we need make iteration into that and print. If we have 5 items into our set, we have to iterate 5 times into the set and each time print an item.
For make iterations, we use loops. Python has 2 loops, for and while. Let’s see their syntax.
While Loop:
i = 1
while i < 6:
print(i)
i += 1
else:
print("i is no longer less than 6")Here, i is a variable and it is using for set a initiate value. The initiate value use to find index number or the starting point. Then it set the condition, and starting iterate until the condition met. And then it set the difference of every iteration.
It will continue iterating until the condition will break. After setting the full process, it will come into else. We can use while without else. Else is not mandatory, we will use it if we need.
For loop:
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)Here, we run a iteration by for loop. It is very simple, just set a variable and tell the list’s name to interpreter, and then print the items. Here, the process is the variable take items by list’s index and print that. By that, it will take all of the item once and print all of them.
-
1213. Break and ContinueVideo lesson
Break and Continue
Loops iterate the set of code until the condition got over. But if we wish, we can break the iteration or skip a single iteration from all of the iterations.
For that, we use break and continue. break keyword is used to break the iterations or stop the operaton. Let’s see an example:
for val in "string":
if val == "i":
break
print(val)
print("The end")
Here, when iteration goes to “i”, it has stopped the operation. I hope all of you understand that.
Now, if I want to ignore one iteration only, then I have to use continue keyword.
for val in "string":
if val == "i":
continue
print(val)
print("The end")
Here, when iteration goes to “t”, it is just skip that and move to next iteration.
-
1314.Function IntroductionVideo lesson
Function Part: 1
Function is a collection of code. We can normally write codes, so what is the necessity of using function?
When we write the code, it makes the actions instantly. But when we write a function, it don’t execute instantly. It only execute when we call the function. We can easily reuse any code by a function. Let’s see an example of a function.
def func1(name):
print("Hello, " + name + ". Good morning!")
func1('Paul')
Here, the name of function is greet. And print is the body of function. When we call the function, then the code will execute. The syntax of calling a function is
function_name()
Arguments
Sometime we need to pass information outside from the function. So, these information can be passed into functions as arguments.
Arguments are specified after the function name, inside the brackets. We can add as many arguments as we want; just we have to separate them with a comma. Let’s see an example of a function which is using a argument.
def my_function(fn):
print(fn + " ,How are you?")
my_function("John")
my_function("Benn")
my_function("Popeyes") -
1415. Function ArgumentsVideo lesson
Function Arguments
We already know that what is argument and its use. We can set more than one argument in a function.
But, we have to keep in mind that which number of function we use as argument, while we call it, we have to pass the same number of argument. If we set 3 arguments in a function, we have to pass 3 arguments at the time of calling. If we miss 1 or give extra 1, Interpreter will show an error.
Let’s see an example:
def my_function(child3, child2, child1):
print("The youngest child is " + child3)
my_function(child1 = "Emil", child2 = "Tobias", child3 = "Linus")Arbitrary Keyword Arguments
If we don’t sure how many arguments we have to pass, then we can use keyword arguments. For making a keyword argument, add two asterisks: ** before the parameter name in the function definition. Let’s see an example:
def my_function(**kid):
print("His last name is " + kid["lname"])
my_function(fname = "Tobias", lname = "Refsnes") -
1516.Function - RecursionVideo lesson
Recursion
Recursion means, when a function calls itself inside of own. Recursion is a common mathematical and programming concept. It means that a function calls itself. This has the benefit of meaning that you can loop through data to reach a result.
But, we have to keep in mind that we can’t call make a recursion which never terminate. If we do that, our system will crash. Lets see an example:
def recur(a):
if(a > 0):
result = a + recur(a - 1)
print(result)
else:
result = 0
return result
print("nResults")
recur(6)Return Values
A function is a collection of code. When it called, it executes. If we want a specific value from a function, then we have to use return keyword. Let’s see an example:
def my_function(x):
return 5 * x
print(my_function(3))Function definition cannot be empty. But, for some reason if we need to put definition of function empty, we can use pass. Let’s see an example:
def myfunction():
pass -
1617. Built In FunctionVideo lesson
Built In Function
Already we know that function is a set of code. So we can make a function and we can keep codes inside that and when we need, we can call that.
But, in python there are some built in function. What is built in function?
Built in function means the developers of python already make some default functions for us, we don’t to need define or make any functions. We have to just call and use. Let’s introduce with of them:
print() = Print or Make output any data
input() = Take any input from user
type() = Check any item’s data type
str() = Convert any data to string
int() = Convert any data to integer
float() = Convert any data to float
len() = To check any data’s length
etc…
Python has many built in function, we don’t need to memorize them all. But, we need to practice them.
All of you can practice that from: https://docs.python.org/3/library/functions.html
Best of Luck!
-
1718. Lambda FunctionsVideo lesson
Lambda Functions
Sometime we need to make anonymous function, which has no identity. Mainly we use it when we need to put a function in another function. A lambda function can take any number of arguments, but can only have one expression. Let’s learn the syntax of lambda functions and see an example:
lambda arguments : expression
Example
Add 10 to argument a, and return the result:
ab = lambda a : a + 10
print(ab(5))def func(n):
return lambda a : a * n
mydoubler = func(2)

External Links May Contain Affiliate Links read more