Udemy, Inc. Is An American Massive Open Online
Udemy, Inc. Is An American Massive Open Online
Company Background:
As of January 2020, the platform has more than 35 million students and 57,000
instructors teaching courses in over 65 languages. There have been over 400 million
course enrollments. Students and instructors come from 180+ countries and 2/3 of the
students are located outside of the U.S.
Students take courses largely as a means of improving job-related skills. Some courses
generate credit toward technical certification. Udemy has made a special effort to attract
corporate trainers seeking to create coursework for employees of their company.[4] As
of 2020, there are more than 130,000 courses on the website.
Training Objective:
1.1.Python
other languages use punctuation, and it has fewer syntactical constructions than other
languages.
need to compile your program before executing it. This is similar to PERL and PHP.
Python is Interactive: You can actually sit at a Python prompt and interact with the
programmers and supports the development of a wide range of applications from simple
Python was developed by Guido van Rossum in the late eighties and early nineties at
the National Research Institute for Mathematics and Computer Science in the
Netherlands. Python is derived from many other languages, including ABC, Modula-3,
C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages. Python is
copyrighted. Like Perl, Python source code is now available under the GNU General
Public License (GPL). Python is now maintained by a core development team at the
institute, although Guido van Rossum still holds a vital role in directing its progress.
1.3. Python features:
• Easy-to-learn: Python has few keywords, simple structure, and a clearly defined
• Easy-to-read: Python code is more clearly defined and visible to the eyes.
• A broad standard library: Python's bulk of the library is very portable and cross
• Mode: Python has support for an interactive mode which allows interactive testing
• Portable: Python can run on a wide variety of hardware platforms and has the same
Extendable: You can add low-level modules to the Python interpreter. These
efficient.
GUI Programming: Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows
Scalable: Python provides a better structure and support for large programs than
shell scripting.
1.4. Python has a big list of good features:
large applications.
It provides very high-level dynamic data types and supports dynamic type checking.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
1.6.Variables in python
A variable in Python represents a named location that refers to value and whose
values can be used and processed during the program run. In other words, variables
are labels/names to which we can assign value and use them as a reference to that
Values are assigned to a variable using a special symbol “=”, called the assignment
or more values. For example, the + operator takes two numbers, one to the left of the
operator and one to the right, and adds them together. Likewise, the “=” operator
takes a value to the right of the operator and assigns it to the name/label/variable on
For Example:
>>> Age = 19
1.8.Naming a variable
You must keep the following points in your mind while naming a variable:-
long names can clutter up the program and make it difficult to read.
Data types are the classification or categorization of data items. Data types represent a
kind of value that determines what operations can be performed on that data.
Numeric, non-numeric, and Boolean (true/false) data are the most used data types.
Numbers
• Integers
• Complex Numbers
Strings
Boolean Values
Operator Description
floor function
by second
Operator Description
!= If the values of the two operands are not equal, then the
condition is true.
> If the value of the left operand is greater than the value of
<= If the value of the left operand is less than or equal to the
its operand.
2. INTRODUCTION TO IF-ELSE
2.1.Simple If statements
Example:
Val = False
if Val == True :
Value is False
To indicate a block of code and separate it from other blocks in Python, you
must indent each line of the block by the same amount. The two statements in
our example of Simple if-statements are both indented four spaces, which is a
Any deviation from the ideal level of indentation for any statement would
Example:
num = 23
if num% 2 == 0 :
else :
Answer:
Odd Number
2.3.if-elif-Else statements
Example:
A = 10
B = 20
C = 30
print(A)
print(B)
else :
print(C)
Output:
30
3. Introduction to loops
n=4
sum = 0
while (i<=n): #The loop will continue till the value of i<number
sum = sum + i
print(sum)
output:
10
3.2.More on loops
a. range() Function
single name.
For Example:
>>> range( 0 , 5 )
returns
3 in [ 1 , 2 , 3 , 4 ]
3.3.For loop
for a in [ 1 , 4 , 7 ]:
print(a)
1. Firstly, the looping variable a will be assigned the first value from the list
i.e. 1, and the statements inside the for loop will be executed with this value of
4. All the values in the list are executed, hence the loop ends.
break Statement
The break statement enables a program to skip over a part of the code. A break
#Statement1
if <condition1>:
#Statement2
#Statement3
continue Statement
The continue statement jumps out of the current iteration and forces the next
while <Expression/Condition/Statement>:
#Statement1
if <condition1>:
continue
#Statement2
#Statement3
pass Statement
● It is generally used as a placeholder for future code i.e. in cases where you
want to implement some part of your code in the future but you cannot
statements, is very useful as empty code blocks are not allowed in these.
n=2
if n== 2 :
else :
print ( "Executed” )
In the above code, the if statement condition is satisfied because n== 2 is True .
Thus there will be no output for the above code because once it enters the if
produced.
4. FUNCTIONS
A function is like a black box that can take certain input(s) as its parameters and
can output a value after performing a few operations on the parameters. A function
is created so that one can use a block of code as many times as needed just by
● Reusability: Once a function is defined, it can be used over and over again.
You can call the function as many times as it is needed. Suppose you are
required to find out the area of a circle for 10 different radii. Now, you can
either write the formula πr 2 10 times or you can simply create a function
that takes the value of the radius as an input and returns the area
corresponding to that radius. This way you would not have to write the same
code (formula) 10 times. You can simply invoke the function every time.
means dividing the code into smaller modules, each performing a specific
task.
A return statement is used to end the execution of the function call and it “returns”
the result (value of the expression following the return keyword) to the caller. The
statements after the return statements are not executed. If the return statement is
1. User-defined functions: Functions that are defined by the users. Eg. The
2. Inbuilt Functions: Functions that are inbuilt in python. Eg. The print()
function.
5. LIST
A list is a standard data type of Python that can store a sequence of values
belonging to any type. The Lists are contained within square brackets ( [ ] ).
[ ] #Empty list
5.1.Operations On Lists
List indices start at 0 and go on till 1 less than the length of the list. We can use
5.2.Negative Indexing
Python allows negative indexing for its sequences. The index of -1 refers to the
last item, -2 to the second last item, and so on. The negative indexing starts from
5.3.Concatenation of Lists
operator ( + ), can be used to join two lists. Consider the example given below:
print(l3)
5.4.List Slicing
List slicing refers to accessing a specific portion or a subset of a list while the
original list remains unaffected. You can use indexes of list elements to create list
Omitting the StartIndex starts the slice from the index 0. Meaning, L[:stop] is
equivalent to L[ 0 :stop] .
print(L[: 3 ])
Output
5.6.Reversing a List
You can reverse a list by omitting both StartIndex and StopIndex and specifying
steps as -1.
print(L[:: -1 ])
Output:
Syntax: <ListName>.append(element)
Example:
>>> li=[ 1 , 2 , 3 , 4 ]
>>> li
[1,2,3,4,5]
Syntax: <ListName1>.extend(<ListName2)
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
>>> l2=[ 5 , 6 , 7 , 8 ]
>>> l1
[1,2,3,4,5,6,7,8]
Example:
>>> li=[ 1 , 2 , 3 , 4 ]
>>> li
[1 , 2 , 5 , 3 , 4 ]
sum() : Returns the sum of all the elements of a List. (Used only for lists containing
numerical values)
Syntax: sum(<ListName>)
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
>>> sum1
10
count() : Returns the total number of times a given element occurs in a List.
Syntax: <ListName>.count(element)
Example:
>>> l1=[ 1 , 2 , 3 , 4 , 4 , 3 , 5 , 4 , 4 , 2 ]
>>> c
Syntax: len(<ListName>)
Example:
>>> l1=[ 1 , 2 , 3 , 4 , 5 ]
>>> len(l1)
5
index() : Returns the index of first occurrence of an element in a list. If element is
Syntax: <ListName>.index(element)
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
>>> l1.index( 3 )
Syntax: min(<ListName>)
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
>>> min(l1)
Syntax: max(<ListName>)
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
>>> max(l1)
pop() : It deletes and returns the element at the specified index. If we don't mention
Syntax: <ListName>.pop([index])
Example:
>>> l1=[ 1 , 2 , 3 , 4 ]
[1,2,4]
Example:
>>> l1=[ 1 , 1 , 12 , 3 ]
>>> l1
[1,1,3]
Syntax: <ListName>.remove(element)
Example:
>>> l1=[ 1 , 1 , 12 , 3 ]
>>> l1.remove( 12 )
>>> l1
[1,1,3]
Looping On Lists
li = [ 1 , 3 , 5 , 7 , 9 ]
for i in li:
Output:
list = [ 1 , 3 , 5 , 7 , 9 ]
print(i)
Output:
9
5.8.Using List Comprehension
List comprehension is an elegant way to define and create a list in Python. We can
Example :
In[2]: print(li)
Here, In[ 1 ] typecasts x in the list input().split() to an integer and then makes
The Python data types can be broadly categorized into two - Mutable and
instance.
memory).
● Its type is defined at runtime and once set it can never change.
● However, its state can be changed if it is mutable . In other words, the value
Note: Objects of built-in types like (int, float, bool, str, tuple, Unicode) are
immutable.
6. STRINGS
● Python strings are immutable , which means they cannot be altered after they are
created.
s1 = 'Hello'
print(s1)
s2 = "Hello"
print(s2)
Output:
Hello
Hello
String indices start at 0 and go on till 1 less than the length of the string. We can use
s= "hello"
Python allows negative indexing for strings. The index of -1 refers to the last
character, -2 to the second last character, and so on. The negative indexing starts
s= "hello"
Joining of two or more strings into a single string is called string concatenation. The
str1 = 'Hello'
str2 = 'World!'
# using +
● If two characters are different, then their Unicode value is compared; the
● < : This checks if the string on its left is smaller than that on its right
● <= : This checks if the string on its left is smaller than or equal to that on its
right
● > : This checks if the string on its left is greater than that on its right
● >= : This checks if the string on its left is greater than or equal to that on its
Right
6.6.Two Dimensional Lists
6.6.1. Introduction
● In this type of list, the position of a data element is referred to by two indices
instead of one.
T = [[ 11 , 12 , 5 , 2 ], [ 15 , 6 , 10, 6 ], [ 10 , 8 , 12 , 5 ], [ 12 , 15 , 8 , 6 ]]
[11, 12 , 5 , 2 ]
10
We can update the entire inner list or some specific data elements of the inner list
T = [[ 11 , 12 , 5 , 2 ], [ 15 , 6 , 10, 6 ], [ 10 , 8 , 12 , 5 ], [ 12 , 15 , 8 , 6 ]]
This can be done the same way as in 1D lists. Consider the examples given below:
T[ 1 ][ 1 ]= 7
T= [[ 11 , 1 , 5 , 2 ], [ 15 , 7 , 10 , 6 ], [ 10 , 8 , 12 , 5 ], [ 12 , 15 , 8 , 6 ]]
6.7.Inserting Values in a Two Dimensional list
We can insert new data elements at any specific position by using the insert()
T.insert( 2 , [ 0 , 5 , 11 , 13 ])
]]
]]
11 12 5 2
15 6 10 6
0 5 11 13
10 8 12 5
12 15 8 6
6.9.Input Of Two Dimensional Lists
n = int(input())
print(input)
User Input:
11 12 5 2
15 6 10 6
0 5 11 13
10 8 12 5
12 15 8 6
Output:
7.1. Tuples
● Objects in a Tuple are immutable i.e. they cannot be altered once created.
● The elements in a tuple can be of different data types like integer, list, etc.
>>> a=( 1 , 2 )
>>> print(a)
(1 , 2 )
>>> print(type(a))
once it is created
Enclosed within parentheses “( )” Enclosed within square brackets “[ ]”
● We can use loops to iterate through a tuple : For example, if we want to print all
● Checking whether the tuple contains a particular element: The keyword used is
in . We can easily get a boolean output using this keyword. It returns True if the
● Finding the length of a tuple: We can easily find the number of elements that any
● Concatenation: We can add elements from two different tuples and form a single
tuple out of them. This process is concatenation and is similar to data types like
string and list. We can use the “ + ” operator to combine two tuples.
Repetition of a Tuple: We can repeat the elements from a given tuple into a
words, by using this operator, we can repeat the elements of a tuple as many times
as we want.
>>> a = ( 1 , 2 , 3 , 4 )
>>> print(a* 4 )
(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
# The same tuple elements are repeated 4 times in the form of another
tuple.
7.3. Dictionaries
which is further followed by a value. This is the value that corresponds to the given
key.
● These keys must be unique and cannot be any immutable data type. Eg- string,
● The values need not be unique. They can be repetitive and can be of any data type
● Dictionaries are mutable, which means that the key-value pairs can be changed.
Simply put pairs of key-value within curly brackets. Keys are separated from their
corresponding values by a colon. Different key-value pairs are separated from each
print(foo[ "a" ])
--> 1
print(foo[ "c" ])
--> 3
This can be done using the method .keys() . This method returns all the different keys
>>> foo.keys()
This can be done using the method .values() . This method returns all the different
>>> foo.values()
dict_values([ 1 , 2 , 3 ])
This can be done using the method .items() . This method returns all the different
items (key-value pairs) present in the dictionary in the form of a list of tuples, with the
first element of the tuple as the key and the second element as the value
>>> foo.items()
7.3. Sets
● The elements in a set cannot be repeated i.e. an element can occur only once.
● The elements in the set are immutable (cannot be modified) but the set as a whole is
mutable.
● There is no index attached to any element in a python set. So they do not support
A set is created by using the set() function or placing all the elements within a pair of
Dates={ 21 , 22 , 17 }
print(Days)
print(Months)
print(Dates)
for d in Days:
print(d)
Wed
Sun
Fri
Tue
Mon
Thu
Sat
>>> print(Days)
>>> print(Days)
print(AllDays)
7.3.6.Intersection of Sets
print(AllDays)
set([ 'Wed' ])
7.3.7. Difference of Sets
print(AllDays)
We can check if a given set is a subset or superset of another set. The result is True or
print(SubsetRes)
print(SupersetRes)
True
True
CONCLUSION
This course has been an excellent and rewarding experience. I can conclude that there have
been a lot I’ve learnt from my work through online teaching. Needless to say, the technical
aspects of the work I’ve done are not flaw less and could be improved provided enough time.
research and discovering new languages was well worth it and contributed to finding an
acceptable solution to an important aspect of web design and development. Two main things
that I’ve learned the importance of are time-management skills and self-motivation. Although
I have often stumbled upon these problems at University, they had to be approached