This presentation is prepared for the academic session of the MOOC course assigned by the BVDU(university) for enhancing the knowledge of students and gaining up the skills. This presentation shows the basics of python programming language.
2. Introduction
Python is a high-level programming
language designed to be easy to read and
simple to implement.
It is open source which means it is free to
use, even for commercial applications.
Scripts written in Python (.PY files) can
be parsed and run immediately.
3. Data science is the field of study that
combines domain expertise,
programming skills, and knowledge of
mathematics and statistics to extract
meaningful insights from data. Data
science practitioners apply machine
learning algorithms to numbers, text,
images, video, audio, and more to
produce AI systems to perform tasks
that ordinarily require human
intelligence.
DEFINITION OF DATA SCIENCE
3
4. Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Boolean Type: Bool
EXAMPLE OF VARIABLES:
A= 3
A = 4
print a
print A
EXAMPLE OF EXPRESSION:
a = 2
b = 3
c = a + b
print c
d = a * b
print d
4
A data type, in programming, is a classification
that specifies which type of value a variable has
and what type of mathematical, relational or
logical operations can be applied to it without
causing an error.
Variables need not be declared first in python.
They can be used directly. Variables in python are
case sensitive as most of the other programming
languages.
Strings are arrays of bytes representing Unicode
characters. However, Python does not have a
character data type, a single character is simply a
string with a length of 1. Square brackets can be
used to access elements of the string.
EXAMPLE:
A = “NANDITA”
Print(“hello”, A)
5. 5
Lists are used to store multiple items in a single
variable.
EXAMPLE:
thislist = ["apple", "banana", "cherry"]
print(thislist)
LIST & TUPLE RANGE DICTONARIES
Tuples are used to store multiple items in a single
variable.
EXAMPLE:
thistuple = ("apple", "banana", "cherry")
print(thistuple)
The range() function returns a sequence of
numbers, starting from 0 by default, and
increments by 1 (by default), and stops before
a specified number.
SYNTAX:
range(start, stop, step)
EXAMPLE:
x = range(3, 6)
for n in x:
print(n)
Dictionaries are used to store data values
in key:value pairs.
A dictionary is a collection which is
ordered*, changeable and does not allow
duplicates
EXAMPLE:
thisdict
= {"brand": "Ford","model": "Mustang
",
"year": 1964}
print(thisdict)
6. Conditional Statement in Python
perform different computations or
actions depending on whether a
specific Boolean constraint evaluates
to true or false. Conditional
statements are handled by IF
statements in Python.
3 / 1 / 2 0 X X S A M P L E F O O T E R T E X T
for i in range(1, 11):
if i == 7:
break
print(i)
print("Loop terminated")
A loop statement allows us to execute a
statement or group of statements multiple
times. The first statement in a function is
executed first, followed by the second, and
so on.
7. f= open("demofile.txt", "r")
print(f.read())
f = open("demofile.txt", "r")
7
To write to an existing file, add a
parameter to the open() function:
• "a" - Append - will append to the end
of the file.
• "w" - Write - will overwrite any
existing content
Example:
f= open("demofile3.txt", "w")
f.write("Woops! I have deleted
the content!")
f.close()
8. HTML is the standard markup language for Web
pages.
With HTML you can create your own Website.
html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Web scraping is an automated method used to extract large amounts
of data from websites. The data on the websites are unstructured. Web
scraping helps collect these unstructured data and store it in a
structured form.
Web scraping is used to collect large information from websites. Some
web applications of web scaping are:
Price Comparison
Email address gathering
Social Media Scraping
Research and Development
8
9. SUMMARY
EDX is a non- profit open source online course
(MOOC) provider which hosts online university-
level courses in wide range. It takes free online
courses from best universities in the world like
Harvard, MIT, UC Berkeley, Microsoft Tsinghua
University and so on. The Verified track awards
a certificate after you successfully pass the
course. It’s a great way to showcase the skills
and knowledge you’ve gained, and will help you
too in your further career.
Learn more on :
https://discover.edx.org/about-us