You are on page 1of 30

An INDUSTRIAL TRAINING PROJECT REPORT

ON
Master Python Course
Submitted in partial fulfillment of requirement for the award of degree of
Bachelor of Engineering in computer science

Submitted to:

Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal (MP)

Under the supervision of: Submitted By:


Mrs. Rashmi Pandey Priyanshu Gupta
Assistant Professor 0905CS141115

Session: 2014-2018

Department of computer science and engineering


INSTITUTE OF TECHNOLOGY & MANAGEMENT,
OPP. SITHOULI RAILWAY STATION, NH-75 SITHOULI, JHANSI ROAD,
GWALIOR
ACKNOWLEDGEMENT

I consider myself very fortunate to get the opportunity to conduct the training
approval by Udemy.com. I got opportunity to get a practical exposure into
actual environment and it provides me the golden opportunity to make my
theoretical concept of recruitment and selection process in a more clear way.
I am very much thankful to Mrs. Rashmi Pandey for providing me the
opportunity to do the training in the Udemy.com. Also, thankful to all the
officials at Mr. Tim Buchalka and J.P Roberts for their cooperation during
my training for providing me necessary information without which this project
report would not have been completed.
I have gone through various sites, Research Books, Magazines and
Newspapers to get the accurate information for analysis and tried to find the
best conclusion.

Priyanshu Gupta (BE VIIth SEM)


PREFACE

Summer training is the most vital part of a BE course, both as a link between
theory and actual industrial practices as well as an opportunity for hands on
experience in corporate environment. I therefore, consider myself fortunate to
receive the training in an esteemed organization viz. Udemy.com. Yet the
opportunity could not have been utilized without the guidance and support of
many individuals who although held varied positions, but were equally
instrument for although completion of my summer training.
Thanks to my faculty members and my parents and friends. However, I accept
the sole responsibility errors of omissions and would be extremely grateful to
readers of this project report if they bring such mistake to my notice.

Priyanshu Gupta

(BE VIIth SEM)


CONTENTS

S.No. Name Page


1 Company Profile
2 Diary
3 Introduction to the language

4 Assignments

5 Testing ( theory)

6 Bibliography

Company Profile
Udemy

Udemy.com is an online learning platform. It is aimed at professional adults.


Unlike academic MOOC programs driven by traditional collegiate coursework,
Udemy provides a platform for experts of any kind to create courses which can
be offered to the public, either at no charge or for a tuition fee. Udemy provides
tools which enable users to create a course, promote it and earn money from
student tuition charges.

History

In 2007, Udemy (YOU-duh-mee) [5] founder Eren Bali built software for a live virtual classroom while living in
Turkey. He saw potential in making the product free for everyone, and moved to Silicon Valley to found a
company two years later. The site was launched by Bali, Oktay Caglar and Gagan Biyani in early 2010.[6]

In February 2010, the founders tried to raise venture capital funding, but the idea failed to impress investors
and they were rejected 30 times, according to Gagan Biyani.[7] In response to this, they bootstrapped the
development of the product and launched Udemy—"The Academy of You"—in May 2010.[7]

Within a few months, 1,000 instructors had created about 2,000 courses, and Udemy had nearly 10,000
registered users. Based on this favorable market reaction, they decided to attempt another round of
financing, and raised $1 million in venture funding by August.[8][9]

In October 2011, the company raised an additional $3 million in Series A funding led by Groupon investors
Eric Lefkofsky and Brad Keywell, as well as 500 Startups and MHS Capital.[10]
In December 2012, the company raised $12 million in Series B funding led by Insight Venture Partners, as
well as Lightbank Capital, MHS Capital and Learn Capital, bringing Udemy’s total funding to $16 million.[11]

On April 22, 2014, the Wall Street Journal's Digital edition reported that Dennis Yang, Chief Operating
Officer of Udemy was named CEO, replacing Eren Bali.[12]

In May 2014, Udemy raised another $32 million in a Series C funding, led by Norwest Venture Partners, as
well as Insight Venture Partners and MHS Capital.[13]
In June 2015, Udemy raised a $65 million Series D financing round, led by Stripes Group. Now Udemy
joined another online learning house Skillsdox Inc of Canada to open up School of Skills in India.
In June 2016, Udemy raised $60 million from Naspers Ventures as a follow-up to the $65 million Series D
round of financing from June 2015.[14]
On June 1, 2017, Udemy announced that the board of the company has appointed Kevin H. Johnson as its
new chief executive officer effective immediately
DIARY
Name of the trainee: Priyanshu Gupta(0905CS141115)
College: Institute of Technology & Management(ITM), Gwalior
Industry/Workplace: Udemy.com
Department/Section: Computer Science

TOPICS NUMBER OF
WEEK NUMBER ASSIGNMENT
( IF PRESENT)
1 Introduction and setup,
basics of python and object 0
oriented programming
2 Python Flow Control 2
3 I/0 In python 2
4 Modules and Function 1
5 Object Oriented Python 1
6 Packages 0

Note:- Included assignments with solutions after introduction


INTRODUCTION

Python is a general-purpose interpreted, interactive, object-oriented, and


high-level programming language. It was created by Guido van Rossum
during 1985- 1990. Like Perl, Python source code is also available under the
GNU General Public License (GPL).

Python is a high-level, interpreted, interactive and object-oriented


scripting language. Python is designed to be highly readable. It uses
English keywords frequently where as other languages use
punctuation, and it has fewer syntactical constructions than other
languages.

● Python is Interpreted − Python is processed at runtime by the interpreter. You do not 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 interpreter
directly to write your programs.

● Python is Object-Oriented − Python supports Object-Oriented style or technique of programming


that encapsulates code within objects.

● Python is a Beginner's Language − Python is a great language for the beginner-level programmers
and supports the development of a wide range of applications from simple text processing to WWW
browsers to games.

History of Python
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.

Python Features
Python's features include −

● Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax. This
allows the student to pick up the language quickly.

● Easy-to-read − Python code is more clearly defined and visible to the eyes.

● Easy-to-maintain − Python's source code is fairly easy-to-maintain.

● A broad standard library − Python's bulk of the library is very portable and cross-platform
compatible on UNIX, Windows, and Macintosh.

● Interactive Mode − Python has support for an interactive mode which allows interactive testing and
debugging of snippets of code.

● Portable − Python can run on a wide variety of hardware platforms and has the same interface on
all platforms.

● Extendable − You can add low-level modules to the Python interpreter. These modules enable
programmers to add to or customize their tools to be more efficient.

● Databases − Python provides interfaces to all major commercial databases.

● GUI Programming − Python supports GUI applications that can be created and ported to many
system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X Window
system of Unix.

● Scalable − Python provides a better structure and support for large programs than shell scripting.

Apart from the above-mentioned features, Python has a big list of good features, few are
listed below
It supports functional and structured programming methods as well as OOP.

● It can be used as a scripting language or can be compiled to byte-code for building

large applications.

● It provides very high-level dynamic data types and supports dynamic type checking.

● IT supports automatic garbage collection.

● It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

# Write a small program to ask for a name and an age.


# When both values have been entered, check if the person

# is the right age to go on an 18-30 holiday (they must be

# over 18 and under 31).

# If they are, welcome them to the holiday, otherwise print

# a (polite) message refusing them entry.

name = input("Please enter your name: ")

age = int(input("How old are you, {0}? ".format(name)))

# if 18 <= age < 31:

if age >=18 and age <31:

print("Welcome to club 18-30 holidays, {0}".format(name))

else:

print("I'm sorry, our holidays are only for seriously cool people")

number = "9,223,372,036,854,775,807"
cleanedNumber = ''

for i in range(0, len(number)):

if number[i] in '0123456789':

cleanedNumber = number[i]

newNumber = int(cleanedNumber)

print("The number is {} ".format(newNumber))

x = 23

x += 1

print(x)

x -= 4

print(x)

x *= 5

print(x)

x /= 4

print(x)
x **=2

print(x)

x %= 60

print(x)

greeting = "Good "

greeting += "morning "

print(greeting)

greeting *= 5

print(greeting)

# += -= *= /= %= **= <<= >>= &= ^= |=


import shelve

locations = shelve.open('locations')

locations['0'] = {"desc": "You are sitting in front of a computer learning Python",

"exits": {},

"namedExits": {}}

locations['1'] = {"desc": "You are standing at the end of a road before a small brick building",

"exits": {"W": 2, "E": 3, "N": 5, "S": 4, "Q": 0},

"namedExits": {"2": 2, "3": 3, "5": 5, "4": 4}}

locations['2'] = {"desc": "You are at the top of a hill",

"exits": {"N": 5, "Q": 0},

"namedExits": {"5": 5}}

locations['3'] = {"desc": "You are inside a building, a well house for a small stream",

"exits": {"W": 1, "Q": 0},

"namedExits": {"1": 1}}


locations['4'] = {"desc": "You are in a valley beside a stream",

"exits": {"N": 1, "W": 2, "Q": 0},

"namedExits": {"1": 1, "2": 2}}

locations['5'] = {"desc": "You are in the forest",

"exits": {"W": 2, "S": 1, "Q": 0},

"namedExits": {"2": 2, "1": 1}}

locations.close()

vocabulary = shelve.open('vocabulary')

vocabulary["QUIT"] = "Q"

vocabulary["NORTH"] = "N"

vocabulary["SOUTH"] = "S"

vocabulary["EAST"] = "E"

vocabulary["WEST"] = "W"

vocabulary["ROAD"] = "1"

vocabulary["HILL"] = "2"

vocabulary["BUILDING"] = "3"

vocabulary["VALLEY"] = "4"
vocabulary["FOREST"] = "5"

vocabulary.close()

# Modify the program from the Second Dictionary challenge of lecture 56

# to use shelves instead of dictionaries.

# Do this by creating two programs. cave_initialise.py should create the two

# shelves (locations and vocabulary) with the appropriate keys and values.

# cave_game.py will then use the two shelves instead of dictionaries.

# Apart from opening and closing the shelves, cave_game will need only

# two changes to the actual code - remember that shelf keys MUST be strings!

# Just to be clear, cave_game.py will contain the code from line 45, everything

# before that (modified to use shelves) will be in cave_initialise.py.

locations = {0: {"desc": "You are sitting in front of a computer learning Python",

"exits": {},
"namedExits": {}},

1: {"desc": "You are standing at the end of a road before a small brick building",

"exits": {"W": 2, "E": 3, "N": 5, "S": 4, "Q": 0},

"namedExits": {"2": 2, "3": 3, "5": 5, "4": 4}},

2: {"desc": "You are at the top of a hill",

"exits": {"N": 5, "Q": 0},

"namedExits": {"5": 5}},

3: {"desc": "You are inside a building, a well house for a small stream",

"exits": {"W": 1, "Q": 0},

"namedExits": {"1": 1}},

4: {"desc": "You are in a valley beside a stream",

"exits": {"N": 1, "W": 2, "Q": 0},

"namedExits": {"1": 1, "2": 2}},

5: {"desc": "You are in the forest",

"exits": {"W": 2, "S": 1, "Q": 0},

"namedExits": {"2": 2, "1": 1}}

vocabulary = {"QUIT": "Q",

"NORTH": "N",
"SOUTH": "S",

"EAST": "E",

"WEST": "W",

"ROAD": "1",

"HILL": "2",

"BUILDING": "3",

"VALLEY": "4",

"FOREST": "5"}

loc = 1

while True:

availableExits = ", ".join(locations[loc]["exits"].keys())

print(locations[loc]["desc"])

if loc == 0:

break

else:

allExits = locations[loc]["exits"].copy()

allExits.update(locations[loc]["namedExits"])
direction = input("Available exits are " + availableExits).upper()

print()

# Parse the user input, using our vocabulary dictionary if necessary

if len(direction) > 1: # more than 1 letter, so check vocab

words = direction.split()

for word in words:

if word in vocabulary: # does it contain a word we know?

direction = vocabulary[word]

break

if direction in allExits:

loc = allExits[direction]

else:

print("You cannot go in that direction")

import pytz
import datetime

country = 'Europe/Moscow'

tz_to_display = pytz.timezone(country)

local_time = datetime.datetime.now(tz=tz_to_display)

print("The time in {} is {}".format(country, local_time))

print("UTC is {}".format(datetime.datetime.utcnow()))

# for x in pytz.all_timezones:

# print(x)

# for x in sorted(pytz.country_names):

# print(x + ": " + pytz.country_names[x])

for x in sorted(pytz.country_names):

print("{}: {}".format(x, pytz.country_names[x]), end=': ')

if x in pytz.country_timezones:

for zone in sorted(pytz.country_timezones[x]):

tz_to_display = pytz.timezone(zone)

local_time = datetime.datetime.now(tz=tz_to_display)

print("\t\t{}: {}".format(zone, local_time))


else:

print("\t\tNo time zone defined")

import datetime
import pytz
class Account:
""" Simple account class with balance """

@staticmethod
def _current_time():
utc_time = datetime.datetime.utcnow()
return pytz.utc.localize(utc_time)

def __init__(self, name, balance):


self._name = name
self.__balance = balance
self._transaction_list = [(Account._current_time(), balance)]
print("Account created for " + self._name)
self.show_balance()

def deposit(self, amount):


if amount > 0:
self.__balance += amount
self.show_balance()
self._transaction_list.append((Account._current_time(), amount))

def withdraw(self, amount):


if 0 < amount <= self.__balance:
self.__balance -= amount
self._transaction_list.append((Account._current_time(), -amount))
else:
print("The amount must be greater than zero and no more then your
account balance")
self.show_balance()

def show_balance(self):
print("Balance is {}".format(self.__balance))

def show_transactions(self):
for date, amount in self._transaction_list:
if amount > 0:
tran_type = "deposited"
else:
tran_type = "withdrawn"
amount *= -1
print("{:6} {} on {} (local time was {})".format(amount, tran_type, date,
date.astimezone()))

if __name__ == '__main__':
tim = Account("Tim", 0)
tim.show_balance()

tim.deposit(1000)
# tim.show_balance()
tim.withdraw(500)
# tim.show_balance()

tim.withdraw(2000)

tim.show_transactions()

steph = Account("Steph", 800)


steph.__balance = 200
steph.deposit(100)
steph.withdraw(200)
steph.show_transactions()
steph.show_balance()
print(steph.__dict__)
steph._Account__balance = 40
steph.show_balance()
FUTURE PROSPECTS AND LIMITATIONS
6.1PREPARATION OF TEST DATA.

A System is programmed by its data. Functional testing can suffer if data is poor, and good data can help
improve functional testing. Good test data can be structured to improve understanding and testability. Its
contents, correctly chosen, can reduce maintenance effort and allow flexibility. Preparation of the data
can help to focus the business where requirements are vague. The first stage of any recogniser
development project is data preparation.

Test data should however, be prepared which is representative of normal business transactions. Actual
customer names or contact details should also not be used for such tests. It is recommended that a full
test environment be set up for use in the applicable circumstances.

Each separate test should be given a unique reference number which will identify the Business Process
being recorded, the simulated conditions used, the persons involved in the testing process and the date
the test was carried out. This will enable the monitoring and testing reports to be co-coordinated with
any feedback received.

Tests must be planned and thought out a head of time; you have to decide such things as what exactly
you are testing and testing for, the way the test is going to be run and applied, what steps are required,
etc.

Testing is the process of creating, implementing and evaluating tests.

Effective quality control testing requires some basic goals and understanding:

You must understand what you are testing; if you're testing a specific functionality, you must know how
it's supposed to work, how the protocols behave, etc.

You should have a good idea of a methodology for the test, the more formal a plan the better; you
should design test cases.

You must understand the limits inherent in the tests themselves.

You must have a consistent schedule for testing; performing a specific set of tests at appropriate points
in the process is more important than running the tests at a specific time.
Roles of Data in Functional Testing

Testing consumes and produces large amounts of data. Data describes the initial conditions for a test,
forms the input, is the medium through which the tester influences the software. Data is manipulated,
extrapolated, summarized and referenced by the functionality under test, which finally spews forth yet
more data to be checked against expectations. Data is a crucial part of most functional testing.

This paper sets out to illustrate some of the ways that data can influence the test process, and will show
that testing can be improved by a careful choice of input data. In doing this, the paper will concentrate
most on data-heavy applications; those which use databases or are heavily influenced by the data they
hold. The paper will focus on input data, rather than output data or the transitional states the data passes
through during processing, as input data has the greatest influence on functional testing and is the
simplest to manipulate. The paper will not consider areas where data is important to non-functional
testing, such as operational profiles, massive datasets and environmental tuning.

A SYSTEM IS PROGRAMMED BY ITS DATA

Many modern systems allow tremendous flexibility in the way their basic functionality can be used.

Configuration data can dictate control flow, data manipulation, presentation and user interface. A system
can be configured to fit several business models, work (almost) seamlessly with a variety of cooperative
systems and provide tailored experiences to a host of different users. A business may look to an
application's configurability to allow them to keep up with the market without being slowed by the
development process, an individual may look for a personalized experience from commonly-
availablesoftware.

FUNCTIONAL TESTING SUFFERS IF DATA IS POOR

Tests with poor data may not describe the business model effectively, they may be hard to maintain,
or require lengthy and difficult setup. They may obscure problems or avoid them altogether. Poor data
tends to result in poor tests, that take longer to execute.

GOOD DATA IS VITAL TO RELIABLE TEST RESULTS

An important goal of functional testing is to allow the test to be repeated with the same result, and varied
to allow diagnosis. Without this, it is hard to communicate problems to coders, and it can become
difficult to have confidence in the QA team's results, whether they are good or bad. Good data allows
diagnosis, effective reporting, and allows tests to be repeated with confidence,.

GOOD DATA CAN HELP TESTING STAY ON SCHEDULE


An easily comprehensible and well-understood dataset is a tool to help communication. Good data
can greatly assist in speedy diagnosis and rapid re-testing. Regression testing and automated test
maintenance can be made speedier and easier by using good data, while an elegantly-chosen dataset can
often allow new tests without the overhead of new data.

6.2TESTING TECHNIQUES WITH DATA

System Testing is very important issue in system development. During system testing the system is used
experimentally to ensure that the system does not fail and will run according to its specification
producing desired outputs as per the user expected from it.

In many organization persons other than those who have written it perform testing, so that the software
will be more reliable. Following tests can carry out the testing of system:
1. White Box Testing.

2. Black Box Testing.

White Box testing:-

White Box Testing, sometimes called glass box testing is a test case design method that uses the control
structure of the procedural design to derive test cases. White Box Testing considers system to be like a
White box, which means that every thing about the system is known to me. The different programs used
in the system, Procedures used, inputs supplied and I know the outputs produced by it in advance.
Person who has developed it generally carries out White Box testing and he/she tests the system against
all odd conditions for extreme values. I tested all the modules independently. In the testing of each
module I tested all the functionality. Right from ‘New or Add’ to ‘Exit or Close’ and from ‘Move-first’
to ‘Move-last’ all were tested. All the if-else structures with various values supplied at various times
were checked. I checked all the loops used in the system and checked at their boundaries too.
White Box Testing in the application is carried out in two parts:

● Alpha Test

● Beta Test

Black Box Testing:-


Black Box Testing focuses on the functional requirements of the software. It uncovers a different class
of errors than white box testing methods. The end users or the ultimate user carries out Black Box
testing for whom the system is made or some one who not knows how the system is being made.
Selecting some persons of the organizations who have to operate on the system can perform this testing
so that they know what inputs to be given to the system for different options and what should the output
generated by the system for those values. To perform this test I selected some persons from the
organization including one senior person also and tested the application. They then evaluated that
whether the system is working properly or not. They all found the system working according to
specification. Some one who neither knows about the work carried out by the system nor about how it is
developed can even perform this test. Thus testing of the system by this method can even be done for
absurd values, which are unknowingly entered by the user.

Unlike White Box Testing which is performed easily in the testing process Black Box Testing
tends to be applied during data stages of testing. Because Black Box Testing purposely disregards
control structure, attention is focused on the information domain. Tests are designed to answer the
following question:-
* How is functional validity tested?

* What classes of input will make good test cases?

TESTING Plan

Here the system testing involved is the most widely used testing process consists of five
stages as shown in the figure. In general, the sequence of testing activities is component
testing, integration testing then user testing. However, as defects are discovered at any
one stage, they required program modifications to correct them and this may required
other stages in the testing process to be repeated.

Testing:-

Testing is the stage of implementation, which is aimed at ensuring that the system words
accurately and efficiently before the live operation commences. It is the process of
executing a program with the explicit intention of finding errors. The logical design and
physical design are comprehensively examined to ensure that it will work when
implemented.

Test data are designed so that system will operate successfully in all aspects and produce
expected results as specified. Thus the preparation of test data and checking of results are
carried out in conjunction with the appropriate administrator, faculty and students.

The basic levels of testing are:

● Unit Testing
● Integration Testing
● System Testing
● Acceptance Testing
BIBLIOGRAPHY

● udemy.com
● python.org
● ipython notebooks
● tutorialpoints.com

You might also like