Uploaded by notpinkman

Python Report (1)

advertisement
Report on programming for
everybody
Online Course
Programming for Everybody (Getting Started with Python)
by
AYUSH KUMAR
Entry. No.: 19BEC017
Submitted in partial fulfilment of the requirements for the award of the degree
of
BACHELOR OF TECHNOLOGY
in
ELECTRONICS AND COMMUNICATION ENGINEERING
SHRI MATA VAISHNO DEVI UNIVERSITY, KATRA
(School of Electronics & Communication Engineering)
JAMMU & KASHMIR – 182 320
Session 2019-23
1
Report on programming for
everybody
CERTIFICATE
2
Report on programming for
everybody
ACKNOWLEDGMENTS
The written words have an unfortunate tendency to regenerate genuine into steel
formality. However, this is the only way we have to record permanently our feelings
it gives us immense pleasure in this online course.
I would like to express my sincere gratitude to my instructor Charles Russell
Severance for providing their invaluable guidance comments and suggestions
throughout the course I would especially thank Mr Charles for constantly motivating
me.
I am thankful to all the faculty members for guiding and letting us know about the
best online course platform like coursera and suggesting such beginner level course
to student like us who was completely unknown to all this course and beautiful
environment of study.
Finally, thanks to team coursera for providing access to courses and continue my
learning for free during this pandemic. Thanks to smvdu for connecting us to coursera
.
3
Report on programming for
everybody
TABLE OF CONTENTS
1. Front page...................................i
2. Certificate...................................ii
3. Acknowledgments..................iii
4. Table of Content......................iv
5. Abstract.......................................v
6. Introduction of Course.........v-vi
7. Overview
Week 1............................vii
Week2.............................vii
Week3............................viii
Week4........................viii-ix
Week5............................ix-x
Week6...........................x-xii
Week7.............................xiii
8. Grades of course....................xiv
4
Report on programming for
everybody
Abstract
This online course entitled to programming for everybody Getting started with
Python. the main objective of the study was to know the basic of programming
language and learn basic beginner level programming in python.
As that would be the base for all that we are all about to study in future and will
boost the understanding level.
As I also heard and felt that python as programming language would fairly be easy
to understand so I decided to first learn this course as I had no knowledge of
programming.
Introduction of course
The course aimed to teach everyone the basics of programming computers using
Python. The course covers the basics of how one constructs a program from a series
of simple instructions in Python. The course has no pre-requisites and avoids all but
the simplest mathematics. Anyone with moderate computer experience should be
able to master the materials in this course. This course will cover Chapters 1-5 of the
textbook “Python for Everybody”.
5
Report on programming for
everybody
The course covers
•
•
•
•
Installation of Python and writing first program
Describe the basics of the Python programming language
Use variables to store, retrieve and calculate information
Utilize core programming tools such as functions and loops
Skills gained on completion of the course
•
•
•
•
6
Python Syntax and Semantics
Basic Programming Language
Computer Programming
Python Programming
Report on programming for
everybody
Overview
WEEK 1
Chapter One - Why we Program?
The first part of Chapter One where we explore what it means to write programs.
We finish Chapter One and have the quiz and first assignment in the third week of
the class.
This week was all about the introduction section of instructor Dr Charles Russell and
some wonderful warming welcome videos and provided the name of few site like
w3school to learn from there and guide us about how to use and how can we submit
assignment and quiz and if not passed how to reconduct.
Just over in the use of Python in web development server-side software
development mathematics system is scripting
And in Python quicker start we come to know that we can write Python programme
in text editor and then put those files into Python interpreted to be executed
WEEK 2
Installation of python in windows 10 and then there was a peer graded assignment
in which we had to submit the screenshot of installed anaconda
After that we also had to grade at least three of our peers.
In this week we studied about: •
•
•
Python syntax
python indentation
Python comments
And by the end of week 3rd we had written our first python programme and there
was also a peer graded assignment and a quiz of objective question.
7
Report on programming for
everybody
WEEK 3
This week was all about the variables: Like basic there is no command to declare variable in python.
And a variable is created at the moment we assign the value to it
This started as: •
•
•
•
•
•
•
•
•
•
Creating variables
Variable names
Casting
How can we get the type of any variables?
Single and double quotes in string variable.
And variables are case sensitive
Multi word variables
Assigning many values to multiple variables
One value to multiple variables
Unpack a collection
At the end of this week, we had a quiz and a simple peer graded assignment and
also to grade at least three of our peers.
There was also a blog video of Mr Chales on University of Michigan
WEEK 4
This week continue from where it was left in previous week and started with python
Output Variables and understanding minure and basic things like Python print
statement is used often to output variables
and continue as: •
•
•
•
8
Global variables
➢ global keyword
Python Data Types
After these two we jumped to python numbers
Here it goes as :▪ Int
Report on programming for
everybody
▪
▪
▪
Float
Complex
Type conversion
And a fact was also highlighted that we cannot convert complex numbers in
to any another number type.
▪
Random number
WEEK 5
This week we started with python casting
There is a many time we want to specify a type on a variable this can be done with
casting
While assigning the values in any variable we also specify the data type of that
values.
And many more thing which comes through the way are: ➢ Strings
▪ Assigning string to a variable
▪ multiple line string
▪ String as array
▪ Looping through a string
▪ String length
▪ Checking and finding strings
▪ Slicing
• Slicing from the start
• Slicing to the end
• Negative indexing
▪ Modifying strings
• Upper case
• Lower case
• Removing white space
• Replace string
• Spliting string
• String concatenation
▪ Python string format
9
Report on programming for
everybody
➢ Python Booleans
In programming we often need to know if an expression is True or
False
And in python we can evaluate any expression, when we compare to
values and python returns the Boolean answer
Almost any value is evaluated to True if it has some sort of content.
▪ Any string is True, except empty string
▪ Any number is True except 0
▪ Any list, set, and dictionary are true, except empty one.
➢ Python operators
Operators are used to perform operations on variables and values:
These are the operators that are covered: ▪
Python Arithmetic Operators
Arithmetic operators are used with numeric values to perform
common mathematical operations.
▪
Python assignment operators
Assignment operators are used to assign values to variables
▪
Python comparison operators
Comparison operators are used to compare two values
▪
Python logical operators
-Used to combine conditional statements
▪
▪
Python Identity Operators
Python membership operators
WEEK 6
This week started with python list and in this week tuple, set, dictionary was
covered.
The lecture was as: 10
Report on programming for
everybody
➢ List
List are used to store multiple variable items in a single variable. And
basic features like ordered , changeable, allow duplicates, list length,
indexing
List are one of four built in data types in python used to store
collections of data, the three others are tuple set and dictionary, all
with different qualities and uses
These are done in list: ▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
▪
Creating list
Check if item exists
Change item value
Change a range of item values
Insert items
Append items
Extend list
Remove specified item
Remove specified index
Clear the list
Loop through a list
Loop through the index numbers
Accessing using while loop
Sort list alphanumerically
Reverse order
Join two list
➢ Tuple
A tuple is a collection which is ordered and unchangeable and allow
duplicates.
These are done in tuple during this course: -
11
▪
▪
Creating tuple
Tuple length
▪
Accessing tuple item
Report on programming for
everybody
▪
▪
▪
▪
▪
▪
▪
Negative indexing
Check if item exists
Remove and change in tuple are done indirectly first change to
list and then perform operations and then again change back to
tuple.
Unpacking a tuple
Loop through a tuple
Loop through the index numbers
Joining two tuples
➢ Set
A set is a collection which is both unordered and unindexed.
Set items are unordered, unchangeable, and do not allow duplicate
values.
We cannot access item in a set by referring to an index or a key.
Once a set is created, you cannot change its items, but you can add new
items.
These are done in set: ▪
▪
▪
▪
▪
▪
▪
Add sets
Add items
Remove item
Loop items
Join two sets
Keep only the duplicates
Keep all, but not the duplicates
➢ Dictionary
▪ Dictionaries are used to store data values in key: value pair
▪ A dictionary is a collection which is unordered, changeable and
does not allow duplicates.
▪ These are done in dictionary: ▪ Dictionary length
▪ Accessing items
12
Report on programming for
everybody
▪
▪
▪
▪
Check if key exists
Change values
Removing items
Loop through a dictionary
WEEK7
This was the last week of this course and in this week following topics and
materials were covered.
▪
▪
▪
▪
▪
▪
Python if...else
elif
The elif keyword is python way of saying “if the previous
conditions were not true then try this condition”.
Nested if
Pass statement
Python while loop
Remember to increment else the loop will continue to forever.
▪
▪
▪
▪
▪
▪
▪
▪
▪
13
Break statement
Continue statement
Python for loop
The range () function
Else in for loop
Nested loop
Python function
Creating a function
Calling a function
Report on programming for
everybody
GRADES
14
Download
Study collections