Menu

Search

3.86 out of 5
3.86
86 reviews on Udemy

Python Fundamental Class

Programming Concept for high School Students
Instructor:
The Apps Firm
16,289 students enrolled
Python Programming Fundamental For Students

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!

2. Programming Fundamental

1
2. Programmer Fundamental I

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.

2
3. Data type Explanations

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.

3
4.Variable

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.


4
5. Operator Precedence

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:

()

**

*, /

+ , -

5
6.String

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.

6
8.List

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.

7. Programmer's Fundamental 2

1
7.Programmers Fundamental 2

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 “””

2
9. Tuple,Set

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)

3
10.Dictionary

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

4
11. if else

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.")

5
12.Loops

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.

6
13. Break and Continue

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.



7
14.Function Introduction

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")


8
15. Function Arguments

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")


9
16.Function - Recursion

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


10
17. Built In Function

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!

11
18. Lambda Functions

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)

19. Python OOP

1
19. Python OOP

Python Object Oriented

Python is an object oriented programming language. What is mean by object oriented? We can solve our problem by creating object. Let’s learn about object

An object has two part:

  • attributes

  • behavior

Let's see an example:

A human is can be an object, as it has the following properties:

  • name, age, height as attributes

  • coding, eating as behavior

The concept of Object Oriented Programming in Python has mainly make for creating reusable code. That’s mean; we don’t need to repeat any code many times.

Now we will learn details about Object. Let’s get started:

At first we will learn about class. Class is mainly constructor/ blueprint of an object.

We can think of class as a blueprint of human with labels. It contains all the details about the name, age height etc. We can study of a human from the class, anywhere and anytime. Here, a human is an object.

The example for class of parrot can be :

class human:

pass

Here, we use the class keyword to define an empty class Human.

2
20. Object

Object

Welcome to this class! In this class, we will learn about object.

Classes are mainly the codes but it cannot allocate memory. By object, we can allocate memory and execute. It can also be used to create new object instances (instantiation) of that class. The procedure to create an object is similar to a function call.

obj1 = Person()

This will create a new object instance named obj1. We can access the attributes of objects using the object name prefix.

Attributes may be data or method. Methods of an object are corresponding functions of that class.

This means to say, since Person.greet is a function object (attribute of class), Person.greet will be a method object.

class Person:

"This is a person class"

age = 10


def greet(self):

print('Hello')



=> create a new object of Person class

obj1 = Person()


=> Output: <function Person.greet>

print(Person.obj1)

3
21.Method,Property

Method

Methods are functions defined inside the body of a class. They are used to define the behaviors of an object. Lets see it by an example:

class Person:
def __init__(self, name, age):
self.name = name
self.age = age

def myfunc(self):
print("Hello my name is " + self.name)

p1 = Person("John", 36)
p1.myfunc()

Here, The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class.

It does not have to be named self , you can call it whatever you like, but it has to be the first parameter of any function in the class:


Modify Object Properties

We can modify an object’s value. Lets see an example:

p1.age = 40

We can delete object’s property by using del keyword.

del.p1.age




Delete Objects

del p1

Pass:

class definitions cannot be empty, but if you for some reason have a class definition with no content, put in the pass statement to avoid getting an error.

class Person:
pass

4
22. Inheritance

Python Inheritance

Sometime we need to use all the methods and properties from another class. Inheritance allows us to define a class that inherits all the methods and properties from another class. Here, Parent class is the class being inherited from, also called base class.

Child class is the class that inherits from another class, also called derived class.

We can use any class as a parent class. We don’t need to give any extra afford to make a class as parent class.

class Person:
def __init__(self, fname, lname):
self.firstname = fname
self.lastname = lname

def printname(self):
print(self.firstname, self.lastname)

#Use the Person class to create an object, and then execute the printname method:

x = Person("John", "Doe")
x.printname()

Here, class named Person, with firstname and lastname properties, and a printname method:

class Student(Person):
def __init__(self, fname, lname, year):
super().__init__(fname, lname)
self.graduationyear = year

def welcome(self):
print("Welcome", self.firstname, self.lastname, "to the class of", self.graduationyear)

At first, we create a new class for child class. Then we have to add a __init__() function. But when we add __init__ function, the child class will no longer inherit the parent's __init__() function. To keep the inheritance of the parent's __init__() function, add a super function to the parent's __init__() function. Then we have to make the properties and methods.

5
23. Iterator

Python Iterators

An iterator is an object that contains a countable number of values..

Technically, in Python, an iterator is an object which implements the iterator protocol, which consist of the methods __iter__() and __next__().

It is mostly similar with __init__.

he __iter__() method acts similar, you can do operations (initializing etc.), but must always return the iterator object itself.

The __next__() method also allows you to do operations, and must return the next item in the sequence.

Example

Create an iterator that returns numbers, starting with 1, and each sequence will increase by one (returning 1,2,3,4,5 etc.):

class MyNumbers:
def __iter__(self):
self.a = 1
return self

def __next__(self):
x = self.a
self.a += 1
return x

myclass = MyNumbers()
myiter = iter(myclass)

print(next(myiter))

6
24. Python Scope

Scope

Scope is an important part of every language. By scope, we can know where I can use my variables.

Scopes are 2 types. Local scope and global scope. Let’s learn about local scope:

A variable created inside a function belongs to the local scope of that function, and can only be used inside that function.

def myfunc():
x = 300
print(x)

myfunc()

Here, x variable is create in myfunc(), so I cant get access of x variable outside of myfunc() function. But if we make a function within a function, and make the variable in inner function, we can use the function anywhere that parent or inner function.

Now lets learn about global scope:

A variable created inside a function with global keyword, belongs to the global scope of that function, and can only be used everywhere

def myfunc():
global x
x = 300

myfunc()

print(x)

Here, as we make the x variable global, we can access it from anywhere.

7
25.Date

Date

We can add current date and time dynamically by python. A date in Python is not a data type of its own, but we can import a module named datetime to work with dates as date objects. Let’s see an example:


import datetime
x = datetime.datetime.now()
print(x)


The date contains year, month, day, hour, minute, second, and microsecond.

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
3.9
3.9 out of 5
86 Ratings

Detailed Rating

Stars 5
27
Stars 4
27
Stars 3
18
Stars 2
5
Stars 1
7
43c87abccd0e97ff33e6a2cb7f826e3b
Course available for 2 days
30-Day Money-Back Guarantee

Includes

2 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion

External Links May Contain Affiliate Links read more

Join our Telegram Channel To Get Latest Notification & Course Updates!
Join Our Telegram For FREE Courses & Canva PremiumJOIN NOW