
This is the introductory video of the 1-Min Python course.
Our uniqueness: each video will be of max 1 minute.
This video will explain that why do we need a programming language
=============================== Notes =====================================
humans can't understand machine language and machines can't understand english language
some examples of coding languages:
Python
Java
C++ etc.
types of translations in coding languages:
compiler based: converts the complete code at once
interpreter based: converts the code line by line
python: interpreter based language
java, C++: compiler based languages
This video will explain the difference between compiler and interpreter based languages
=============================== Notes =====================================
humans can't understand machine language and machines can't understand english language
some examples of coding languages:
Python
Java
C++ etc.
types of translations in coding languages:
compiler based: converts the complete code at once
interpreter based: converts the code line by line
python: interpreter based language
java, C++: compiler based languages
This video explains the concept of datatypes in python
=============================== Notes =====================================
data types: nature of data which will be used while coding
datatypes in python:
int : for integers like -2, -10, 0, 5, 89 etc.
float : for decimal numbers like -2.5, -10.2, 4.5, 6.8 etc.
str : for strings. Eg. letters like "I", words like "India", sentences like "I love India", paragraph like "I hate junk food. It is unhealthy. My friend likes pizza." etc.
bool : True, False
complex : 2 + 3j, 4 + 7j etc.
This video explains the importance of variables in python
=============================== Notes =====================================
use of variables:
values like 10, 20, 30 can be used easily again and again but what about values like 49494932493249732?
bigger values take time to be typed and if needed frequently in a program, it will be very time consuming so we can use variables to store them in a container and can use that container
a = 49494932493249732
print(a)
This video explains the use of None keyword in python
=============================== Notes =====================================
use of keyword "None":
in python, it is mandatory to assign a value whenever a variable is declared. however, if we don't want to do so, we can use "None" keyword.
a = 10
b = 30
c = None
This video explains how to install the correct version of python
=============================== Notes =====================================
Download link: https://www.python.org/downloads/release/python-3810/
Depending upon your OS type, select the correct version
This videos explains rules for naming variables in python
=============================== Notes =====================================
rules for naming variables:
1. must start from an alphabet or undercore "_" only first, place_delhi, _location are valid names
2. can't start with a digit
Eg. 9times, 21century are invalid names
3. can have digits in between
Eg. number2, number_2, number_2_times are valid names
4. can't have any character other than underscore "_"
Eg. price$20 is an invalid name
This video gives the introduction to Google Colab
=============================== Notes =====================================
Google colab link: https://colab.research.google.com/
This video explains the different ways to use print function in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
This video explains the standard way to print in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
1. standard way:
a = 10
print("value of a = ",a)
This video explains the use of comments in python
=============================== Notes =====================================
Use of comments in python: sometimes we want to prevent the execution of a piece of code (may be for documentation purpose), we can use comments and can place that piece of code inside comments.
comments are of 2 types:
a) single line comments
eg.
print("hello")
# this is a single line comment
print("world")
b) multi-line comments
eg.
print("hello")
''' this is a multi line comment
this will not be executed '''
print("world")
note: single line comment can also be used as multi line comment
eg.
print("hello")
# this is a single line comment
# acting as a multi line comment
# this will not be executed
print("world")
This video explains the tuple format to print in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
2. tuple format: (we need to use format specifiers)
for integers, use %d
for strings, use %s
for float, use %f
a = 10
print("value of a = %d" % a)
a = 10
b = 20
print("value of a = %d and b = %d" % (a,b))
This video explains the concept of concatenation in python
=============================== Notes =====================================
concept of concatenation in python:
age = 28
name = "sumit"
salary = 1000
print(salary + age)
print("my username is",name + age)
# print("my username is",name + str(age))
This video explains the string concatenation way to print in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
3. string concatenation
a = 10
b = 20
print("value of a = " + str(a) + " and b = " + str(b))
# print("value of a = ",a," and b = ",b) # standard way
This video explains the format function to print in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
4. format function
a = 10
b = 20
print("value of a = {} and b = {}".format(a,b))
# print("value of a = {0} and b = {1}".format(a,b))
# print("value of a = {1} and b = {0}".format(a,b))
This video explains the f-strings to print in python
=============================== Notes =====================================
use of print function: to give the output on screen
There are 5 ways to use print function:
1. standard way
2. tuple format
3. string concatenation
4. format function
5. f-strings
5. f-strings (formatted strings)
a = 10
b = 20
print(f"value of a = {a} and b = {b}")
This video explains the input function in python
=============================== Notes =====================================
input() function is used to read values from the screen. It reads the value in string format
number = input()
print(number)
# to read a value with some custom message
number = input("Enter the number: ")
print(number)
This video explains the operators in python
=============================== Notes =====================================
Operators in python:
▪ Logical ( and, or, not )
▪ Arithmetic ( +, -, *, /, //, %, ** )
▪ Relational ( ==, !=, etc. )
▪ Assignment ( = ) and Shorthand ( +=, -=, *=, /=, //=, %=, **= )
▪ Membership ( in, not in )
▪ Identity ( is, is not )
▪ Shift
▪ Bitwise ( &, |, ^ )
This video explains the use of sep parameter in print function in python
=============================== Notes =====================================
use of "sep" parameter in print function in python:
values will be separated with this value
its default value is a whitespace (" ")
print("it","is","raining","today")
Output: it is raining today
print("it","is","raining","today",sep="#")
Output: it#is#raining#today
This video explains the use of end parameter in print function in python
=============================== Notes =====================================
use of "end" parameter in print function in python:
its default value is newline ("\n")
print("my name is khan")
print("I live in Dwarka ")
print("my name is khan",end="")
print("I live in Dwarka ")
This video explains the use of import in python
=============================== Notes =====================================
use of import in python:
print("importing complete file...\n")
import a_and_b
print("a_and_b.a = ",a_and_b.a)
print("a_and_b.b = ",a_and_b.b)
print()
print()
print("importing only the variables...\n")
from a_and_b import a,b
print("a = ",a)
print("b = ",b)
This video explains the use of if statement in python
=============================== Notes =====================================
"if" statement can be used for selection in case we need to check for a condition:
print("you are a nice person")
a = input("Is Delhi capital of India: ")
if a == "Y":
print("you are smart too")
print("thanks")
This video explains the use of if-else statement in python
=============================== Notes =====================================
"if-else" statement can be used for selection in case we have two possible cases:
print("you are a nice person")
a = input("Is Delhi capital of India: ")
if a == "Y":
print("you are smart too")
else:
print("you are not that smart")
print("thanks")
This video explains the use of if-elif-else statement in python
=============================== Notes =====================================
"if-elif-else" statement can be used for selection in case we have multiple possible cases:
choice = input("select your desired t-shirt colour (r/g/b): ")
if choice == "r":
print("you picked red colour")
elif choice == "g":
print("you picked green colour")
elif choice == "b":
print("you picked blue colour")
else:
print("incorrect choice")
This video explains the range function in python
=============================== Notes =====================================
range function in python:
It returns a collection of values
range(start, end, step)
start and step are optional while end parameter is mandatory
default value of "start" is 0 and "step" is 1
range(5) # (0,1,2,3,4)
range(2,5) # (2,3,4)
range(2,10,2) # (2,4,6,8)
range(10,5,-1) # (10,9,8,7,6)
This video explains the for loop in python
=============================== Notes =====================================
for loop can be used to iterate over a collection:
value from the collection will be received by the loop variable one by one
range(5) will return (0,1,2,3,4)
for i in range(5):
print(i)
Output:
0
1
2
3
4
This video explains the while loop in python
=============================== Notes ===================================== while loop can be used if we want to perform iteration using a specific condition
3 aspects of while loop:
initialization of loop variable
condition check
updation of loop variable
i = 1 # initialization
while i <= 10: # condition check
print(i)
i = i + 1 # updation
Output:
1
2
3
4
5
6
7
8
9
10
This video explains the strings in python
=============================== Notes =====================================
strings are immutable collections whose value once assigned can't be modified later
name = "Sumit"
or
name = 'Sumit'
strings support indexing (starting from 0)
print(name[0]) # "S"
name[0] = "P" # error
strings also support slicing
name = "Washington"
print(name[2:6]) # "shin"
This video explains the lists in python
=============================== Notes =====================================
list is a mutable collection (its contents can be changed) which can store any type of values
list can be created either by using function or by square bracket [ ]
lst = list()
or
lst = [11, "Sumit", 1.5, True]
print(lst)
to add an element in list:
lst.append(22)
print(lst)
to remove an element from the last: l
st.pop()
print(lst)
to remove an element if index is known:
lst.pop(2)
print(lst)
This video explains the tuples in python
=============================== Notes =====================================
tuple is an immutable collection (its contents can't be changed directly) which can store any type of values
tuple can be created either by using function or by parenthesis bracket ()
tup = tuple()
or
tup = (11, "Sumit", 1.5, True)
print(tup)
to change tuple values, first convert into list, do the changes and convert back to tuple:
print(tup)
tup = list(tup)
tup.append(22)
tup = tuple(tup)
print(tup)
This video explains the dictionaries in python
=============================== Notes =====================================
dict is a mutable collection (its contents can be changed) which stores the values as key-value pairs
dct = { "key1" : "value1", "key2" : "value2", "key3" : "value3" }
to add/update a pair:
dct["key4"] = "value4"
to remove a pair:
dct.pop("key4")
or
del dct["key4"]
This video explains the sets in python
=============================== Notes =====================================
set is a mutable collection (its contents can be changed) which can store any type of values but only unique values can be stored and duplicated values will be discarded
set can be created either by using function or by curly bracket {}
st = set()
or
st = {11, "Sumit", 1.5, True}
print(st)
to add an element in set:
st.add(22)
print(st)
to remove an element from the set:
st.remove(22)
print(st)
Note: sets don't support indexing
This video explains the exception handling in python
=============================== Notes =====================================
exception handling can be used to prevent our program to get crashed
try and except blocks are used
try:
the code which can throw the exception
except:
code to handle that exception
=== unhandled execution ===
first = int(input("enter first number: "))
second = int(input("enter second number: "))
print(first/second)
=== handled exception ===
try:
first = int(input("enter first number: "))
second = int(input("enter second number: "))
print(first/second)
except:
print("Division by zero is not allowed")
This video explains the functions in python
=============================== Notes =====================================
functions are a self executable piece of instructions which can be used for code reusability.
We can wrap the frequently used code inside a function body
non-parameterized functions:
def func():
print("I am Sumit")
print("I am in 12th standard")
print("I am from XYZ school")
func() # function call
parameterized functions:
def func(name,standard,school):
print(f"I am {name}")
print(f"I am in {standard}th standard")
print(f"I am from {school} school")
func("Amit",11,"ABC")
function can return values as well using return keyword:
def multiplier(x,y):
return x*y
result = multiplier(10,20)
print(result)
This video explains the OOPS concept in python
=============================== Notes =====================================
OOPS stands for Object Oriented Programming System
It works on the real world scenarios and in this system, data is given more importance rather than functions i.e. doing a task is more important instead of the way it is being done
It has 4 main priciples:
1. Data Encapsulation
2. Data Abstraction
3. Inheritance
4. Polymorphism
This video explains the classes and objects in python
=============================== Notes =====================================
Class: It is a user defined data type which can be made with some features in it which its variables will be having. A class acts as a blue print.
Objects: the running instance of a class is known as its object
Eg. A human being will have features like hands, legs, head, brain, heart. So, human being can be created as a class and its variables will have all these features
This video explains the static methods in python
=============================== Notes =====================================
static functions: which are just a part of a class and not related to any object of a class.
"@staticmethod" decorator needs to be used to declare a method as a static method
class Calc:
@staticmethod
def adder(a,b):
print(a+b)
class name should be used to call a static method.
Calc.adder(10,20)
However, objects can also call it
obj = Calc()
obj.adder(30,40)
This video explains the class methods in python
=============================== Notes =====================================
class methods: they are used to manage the class data that can be shared by the whole class.
"@classmethod" decorator is used to declare a method as a class method.
class Employee:
leaves = 12
bonus = 10000
@classmethod
def get_leaves(cls):
print(cls.leaves)
@classmethod
def get_bonus(cls):
print(cls.bonus)
obj1 = Employee()
obj1.get_leaves() # 12
obj1.get_bonus() # 10000
obj2 = Employee()
obj2.get_leaves() # 12
obj2.get_bonus() # 10000
This video explains the instance methods in python
=============================== Notes =====================================
instance methods: different objects have different values of instance variables (data fields). Instance methods manage the data of instance variables.
class Calc:
def __init__(self,n,a):
self.name = n
self.age = a
"init" method gets called automatically whenever an object gets created.
"self" is used to reference the invoking object
obj1 = Calc("Amit",20)
print(obj1.name," and ",obj1.age)
obj2 = Calc("Sumit",40)
print(obj2.name," and ",obj2.age)
This video explains the encapsulation in python
=============================== Notes =====================================
Data encapsulation: wrapping up of data fields and the related functions in a single unit is called as Data encapsulation.
A class is an example of data encapsulation
class HumanBeing:
hands = 2
legs = 2
brain = 1
heart = 1
person = HumanBeing()
print(person.hands) # 2
This video explains the abstraction in python
=============================== Notes =====================================
Data Abstraction: showing only the useful data and hiding the irrelevant details is known as Data Abstraction
class HumanBeing:
hands = 2
legs = 2
brain = 1
heart = 1
person = HumanBeing()
print(person.hands) # 2
This video explains the simple inheritance in python
=============================== Notes =====================================
Inheritance: transferring the features of one class into another class is known as Inheritance.
The class from which features are transferred is called Parent class and the class in which features are transferred is known as Child class
Types of inheritance:
1. simple
2. multiple
3. multilevel
4. hierarchical
5. hybrid
class Parent:
cash = 100000
cars = 2
flats = 3
class Child(Parent):
bike = 1
obj = Child()
print(obj.bike) # 1
print(obj.cash) # 100000
print(obj.cars) # 2
print(obj.flats) # 3
This video explains the multiple inheritance in python
=============================== Notes =====================================
Types of inheritance:
1. simple
2. multiple
3. multilevel
4. hierarchical
5. hybrid
multiple inheritance: whenever a class inherits from two or more parent classes
class Parent1:
def func1(self):
print("this is func1 from parent1")
class Parent2:
def func2(self):
print("this is func2 from parent2")
class Parent3:
def func3(self):
print("this is func3 from parent3")
class Child(Parent1, Parent2, Parent3):
def func4(self):
print("this is func4 from child")
obj = Child()
obj.func1()
obj.func2()
obj.func3()
obj.func4()
This video explains the multilevel inheritance in python
=============================== Notes =====================================
multilevel inheritance: inheritance happens at multiple levels
grandfather
|
|
father
|
|
child
class Grandfather:
def grand_func(self):
print("grand_func from grandfather")
class Father(Grandfather):
def father_func(self):
print("father_func from father")
class Child(Father):
def func(self):
print("func from child")
obj = Child()
obj.func()
obj.father_func()
obj.grand_func()
This video explains the hierarchical inheritance in python
=============================== Notes =====================================
Hierarchical inheritance: when there is a single parent class and multiple child classes
class Parent:
def parent_func(self):
print("this is parent_func from parent")
class Child1(Parent):
def func1(self):
print("this is func1 from child1")
class Child2(Parent):
def func2(self):
print("this is func2 from child2")
class Child3(Parent):
def func3(self):
print("this is func3 from child3")
obj1 = Child1()
obj2 = Child2()
obj3 = Child3()
obj1.parent_func()
obj2.parent_func()
obj3.parent_func()
This video explains the hybrid inheritance in python
=============================== Notes =====================================
Hybrid inheritance: when more than 1 type of inheritances are happening at the same time
Parent
|
------------------------
| |
| |
Child1 Child2
|
|
Child3
This is an example of hierarchical as well as multilevel inheritances
class Parent:
def parent_func(self):
print("this is parent_func from parent")
class Child1(Parent):
def func1(self):
print("this is func1 from child1")
class Child2(Parent):
def func2(self):
print("this is func2 from child2")
class Child3(Child2):
def func3(self):
print("this is func3 from child3")
obj1 = Child3()
obj1.func2()
obj1.parent_func()
This video explains the method overloading in python
=============================== Notes =====================================
Polymorphism: Occurrence in multiple forms.
It is achieved by method overloading and operator overloading
Method overloading: calling a same method with different parameters at the same time
class Calc:
@staticmethod
def adder(a=0,b=0,c=0,d=0):
print(a+b+c+d)
Calc.adder(10,20)
Calc.adder(10,20,30)
Calc.adder(10,20,30,40)
This video explains the operator overloading in python
=============================== Notes =====================================
Operator overloading: using a predefined operator with a user defined variable (object)
class Person:
def __init__(self,a):
self.age = a
def __add__(self,obj):
return self.age + obj.age
obj1 = Person(10)
obj2 = Person(20)
print(obj1 + obj2)
This video explains the comprehensions in python
=============================== Notes =====================================
Comprehensions: it is a shortcut to create a collection based on a certain condition
lst = []
for i in range(10):
if i%2 == 0:
lst.append(i)
print(lst)
print([i for i in range(10) if i%2 == 0]) # using comprehension
we can create a collection without any condition as well
print([i for i in range(10)])
comprehensions can also be used to create set and dict
This video explains the decorators in python
=============================== Notes =====================================
Decorator: it can be used to enhance the functionality of a function
def adder(a,b):
print(a+b)
adder(10,20)
def dec(func):
def inner(x,y):
print("before function call")
func(x,y)
print("after function call")
return inner
@dec # decorator applied
def adder(a,b):
print(a+b)
adder(10,20)
Output:
before function call
30
after function call
This video explains the generators in python
=============================== Notes =====================================
Generators: we can generate the value only when the function is called instead of holding all the value in memory
gen = (i*i for i in range(10))
print(next(gen))
print(next(gen))
print(next(gen))
"yield" keyword can also be used to create a generator
def square(n):
for i in range(n):
yield i*i
gen2 = square(10)
print(next(gen2))
print(next(gen2))
print(next(gen2))
This video explains the lambda functions in python
=============================== Notes =====================================
Lambda functions: they are anonymous functions which can be used if a single line logic is there
def square(num):
return num*num
print(square(20)) # 400
func = lambda x : x*x
print(func(10)) # 100
This video explains the monkey patching in python
=============================== Notes =====================================
Monkey patching: for testing purpose, we modify the functionality of a function and after testing, we can set it back to its original functionality
class Sample:
def func1(self):
print("this is func1 from Sample")
def func2(self):
print("this is func2 from Sample")
def monkey_patch(self):
print("this is a patch for testing")
patch = Sample.func2
Sample.func2 = Sample.monkey_patch # monkey patching done
obj = Sample()
obj.func2()
Sample.func2 = patch # functionality restored
obj.func2()
Congratulations on the completion of the course!
Please share this course in your study circle so that they can also get the benefit of it
For any enquiries, kindly reach out to us at: dwarkacodingclub@gmail.com
Best of luck for your career.
Thank you so much!
Regards
Dwarka Coding Club
This is a unique course on Udemy which comes with a USP that NO VIDEO EXCEEDS 1 MINUTE.
The complete course takes just about 42 minutes to complete and you can complete it as many times as you want to get the better clarity each time. This is designed for absolute beginners who don't know anything about python but have an enthusiasm to learn the language.
This course would cover the fundamentals of the Python programming language, including data types, variables, control structures, functions, modules, and object-oriented programming.
This course is designed to help students gain a solid understanding of Python programming and develop the skills needed to build their own applications.
Python is a versatile programming language that can be used for a wide range of applications, from web development to data analysis and scientific computing. Here are some of the core topics that are covered in this Python course:
Introduction to Python: This includes an overview of the language syntax, data types, variables, operators, and control structures.
Functions and Modules: This covers how to define and use functions, how to import and use modules, and how to create your own modules.
Object-Oriented Programming: This covers the basics of object-oriented programming in Python, including classes, objects, encapsulation, inheritance, and polymorphism.
Data Structures: This covers the various built-in data structures in Python, such as lists, tuples, sets, and dictionaries, and how to use them effectively.
Exception Handling: This covers how to handle errors and exceptions in Python using try-except blocks.
Best Practices: This covers some of the best practices for writing clean, efficient, and maintainable Python code, such as code organization, naming conventions, and documentation.
Overall, this course covers a wide range of topics.
Best of luck and Happy learning!