Internship Daily Task Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

||| DAY - 1

BASIC INTRODUCTION AND DOMAIN KNOWLEDGE


1. LIST OUT PYTHON KEYWORDS AND OPERATORS?
A: KEYWORDS:
Value Keywords: True, False, None
Operator Keywords: and, or, not, in, is
Control Flow Keywords: if, elif, else
Iteration Keywords: for, while, break, continue, else
Structure Keywords: def, class, with, as, pass, lambda
Returning Keywords: return, yield
Import Keywords: import, from, as
Exception-Handling Keywords: try, except, raise, finally, else,
assert
Asynchronous Programming Keywords: async, await
Variable Handling Keywords: del, global, nonlocal
The true and false are the truth value in Python.
The class keyword is used to define new user-define class in Python.
The def is used to define user-defined function.
The return keyword is used to go back from a function and send a value to the invoker
function.
The if, elif, else keywords are used for conditional branching or decision making.
The try, except, raise, finally keywords are used to handle different exceptions in
Python.
The for keyword is basically the for loop in Python.
The in keyword is used to check participation of some element in some container
objects.
The is keyword is used to test the identity of an object.
The not keyword is used to invert any conditional statements.
The import keyword is used to import some modules into the current namespace.
The from…import is used to import some special attribute from a module.
The global keyword is used to denote that a variable, which is used inside a block is
global variable.
The lambda keyword is used to make some anonymous function.
The with statement is used to wrap the execution of a set of codes, within a method,
which is defined by the context manager.
The as keyword is used to create an alias.
The nonlocal keyword is used do declare a variable in a nested function is not local to
it.
The pass keyword is basically the null statement in Python.
The while is the while loop in Python.
The break statement is used to come out from the current loop, and the control moves
to the section, which is immediately below the loop.
The continue is used to ignore the current iteration.
The and keyword is used for logical and operation in Python.
The yield keyword is used to return a generator.
The del keyword is used to delete the reference of an object.
The or keyword performs the logical or operation.
The assert statement is used for debugging.
The None is a special constant in Python. It means null value or absence of value.
=>OPERATORS:
Arithmetic Operators:
Operator Name Example
+ Addition x + y
- Subtraction x - y
* Multiplication x * y
/ Division x / y
% Modulus x % y
** Exponentiation x ** y
// Floor division x // y

Assignment Operators:
Operator Example Same As
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x - 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
>>= x >>= 3 x = x >> 3
<<= x <<= 3 x = x << 3

Logical Operators:
Operato Description Example
r
and  Returns True if both statements x < 5 and  x < 10
are true
or Returns True if one of the x < 5 or x < 4
statements is true
not Reverse the result, returns False not(x < 5 and x < 10)
if the result is true
Comparison (Relational) Operators:
Operator Name Example
== Equal x == y
!= Not equal x != y
> Greater than x > y
< Less than x < y
>= Greater than or equal to x >= y
<= Less than or equal to x <= y

Bitwise Operators:
Operator Name Description
&  AND Sets each bit to 1 if both
bits are 1
| OR Sets each bit to 1 if one of
two bits is 1
 ^ XOR Sets each bit to 1 if only one
of two bits is 1
~  NOT Inverts all the bits
<< Zero fill left Shift left by pushing zeros in
shift from the right and let the
leftmost bits fall off
>> Signed right Shift right by pushing copies
shift of the leftmost bit in from
the left, and let the
rightmost bits fall off

Membership Operators:
Operato Description Example
r
in  Returns True if a sequence with the x in y
specified value is present in the object
not in Returns True if a sequence with the x not in y
specified value is not present in the
object

Identity Operators:
Operator Description Example
is  Returns True if both variables x is y
are the same object
is not Returns True if both variables x is not
are not the same object y
2. EXPLAIN STRUCTURED, UNSTRUCTURED, SEMI STRUCTURED DATA
WITH EXAMPLE?
A: These are 3 types: Structured data, Semi-structured data, and Unstructured
data.
1.Structured data –
Structured data is data whose elements are addressable for effective analysis.
It has been organized into a formatted repository that is typically a database.
It concerns all data which can be stored in database SQL in a table with rows and
columns. They have relational keys and can easily be mapped into pre-designed
fields.
Today, those data are most processed in the development and simplest way to
manage information. Examples include names, dates, addresses, credit card
numbers, stock information, geolocation, etc.

2.Semi-Structured data –
Semi-structured data is information that does not reside in a relational database but
that has some organizational properties that make it easier to analyse.
With some processes, you can store them in the relation database (it could be very
hard for some kind of semi-structured data), but semi-structured exist to ease space.
Examples are: Rich media. Media and entertainment data, surveillance data,
geo-spatial data, audio, weather data.
3.Unstructured data –
Unstructured data is a data which is not organized in a predefined manner or does
not have a predefined data model; thus, it is not a good fit for a mainstream relational
database.
So, for unstructured data, there are alternative platforms for storing and managing, it
is increasingly prevalent in IT systems and is used by organizations in a variety of
business intelligence and analytics applications.
Example are: Word, PDF, Text, Media logs.

3. BUILD A GST CALCULATION PROGRAM WITH MULTIPLE CATEGORIES


HAVING DIFFERENT PERCENTAGES.
#GST CALCULATOR PROGRAM
A = int(input("Enter amt to apply GST on it:"))

print("1)FOOD 2)TEMP. ITEMS 3)ELECTRICAL DEVICES 4)OTHER GOODS")


B = int(input("Enter choice : "))
if B == 1: print("GST RATE 5% = ",A * 5/100 ,"\nPAYABLE AMT:",A + A * 5/100 )
elif B == 2: print("GST RATE 12% = ",A * 12/100 ,"\nPAYABLE AMT:",A + A * 12/100)
elif B == 3: print("GST RATE 18% = ",A * 18/100 ,"\nPAYABLE AMT:",A + A * 18/100)
elif B == 4: print("GST RATE 28% = ",A * 28/100 ,"\nPAYABLE AMT:",A + A * 28/100)
else:
print("enter valid choice")

O/P:
||| DAY – 2
4.LIST OUT 5 METHODS OF LIST, SET AND DICTIONARY,
EXPLAIN THEM WITH EXAMPLE
A: LIST:
Lists are the build-in data-types in python that are used
to store multiple items in a single variable. The plus point
of list is that the order of list does not change, and the
items in the list are changeable (mutable) and the last
point as the list allows duplicate values too.

Example: a= [‘ABAD’,’INST’,’TECH’]

LIST Methods:
- .append(x) : Add an item to the end of the list
- .insert(i, x): Inserting an item at a given position
- .remove(x) : removing the first item from the list whose value is
equal to x
- copy(): Copying of the list
- count(): Number of elements with the specified value
- reverse() : reverse the list
CODE:

o/p:
SET:
- Sets are also used to store multiple items in a single variable.
- In set there is no order and no index.
- The down point of set data type is the value cannot be
changed once the set is created immutable
- Repetition of values are not allowed in set.

SET Methods:
a. add(): adds element to a set
b.discard(): Removes an Element from The Set
c.isdisjoint(): Checks Disjoint Sets
d.issubset(): Checks if a Set is Subset of Another Set
e.union(): Returns the union of sets
f. update(): Add elements to the set
g.clear(): remove all elements from a set

CODE:
o/p:

DICTIONARIES:
- Storing of values
- Ordered , changeable(mutable) , doesn’t allow change of values

Dictionary Methods:
a. get() - Returns the value of the specified key
b. items() - Returns a list containing a tuple for each key value
c. pair keys() - Returns a list containing the dictionary's keys
d. pop() - Removes the element with the specified key
e. popitem() - Removes the last inserted key-value pair

CODE:

O/P:
CODE:

O/P:
5.Build a student report card program which can take subject, marks as
input and return the marks of student using functions.
A: CODE:

O/P:
6.Build a program to find factorial, prime & odd - even from user input
A: CODE:

O/P:
||| DAY – 3
7.BUILD A ATM PROGRAM CONTAINING DEPOSIT AND
WITHDRAW FUNCTIONS WITH VALIDATIONS AND LOOP USING
CLASS.
A: CODE:

O/P:
8.LIST OUT 5 INBUILT LIBRARIES OF PYTHON AND USE THEIR 3
METHODS WITH EXAMPLES.
A: Inbuilt Libraries of Python include:
1-Pandas:
They are primarily used for data analysis, manipulation, cleaning, etc.
Pandas allow for simple data modelling and data analysis operations.
METHODS OF PANDAS:
(1) describe():The describe() method returns description of the data in
the DataFrame.
CODE:

O/P:
(2) memory_usage() returns a Pandas Series having the memory usage of each
column (in bytes) in a Pandas Code.

o/p:

(3)merge():Pandas provides a single function, merge, as the entry point for all


standard database join operations between DataFrame objects.
CODE:

O/P:

2-Numpy:
NumPy is a Python library used for working with arrays.
It also has functions for working in domain of linear algebra, fourier,
transform, and matrices. NumPy stands for Numerical Python.
Methods of NumPy:

9.LIST OUT ATLEAST 10 META CHARACTERS AND USE THEM IN


PATTERN FOR EMAIL AND PHN NUMBER VALIDATION.
A: Meta characters:
Metacharacte Description Example
r
[] It represents the set of characters. "[a-z]"
\ It represents the special sequence. "\r"
. It signals that any character is present "TN.R."
at some specific place.
^ It represents the pattern present at the "^AIT"
beginning of the string.
$ It represents the pattern present at the "point"
end of the string.
* It represents zero or more occurrences "hello*"
of a pattern in the string.
+ It represents one or more occurrences of "hello+"
a pattern in the string.
{} The specified number of occurrences of a "ait{2}"
pattern the string.
| It represents either this or that "abad|
character is present. ins"
() Capture and group (abdinst
)

Code: Email validation:

O/P:

Code: Phone number validation:


O/P:

Day 4:
10.Use any external library and inbuilt library in one python program with
user input.
A: Code:

O/P: mp3 is saved and can be played


Code:

o/p:

11.Create signup page with basic css properties and validation.


A: Code:
o/p:

Day 5:
12.Create a Django project with application
A:
Day 6:
13.Create multiple html files using internal css with working navigation
bar.

Day 7:
14.Create a responsive website page using bootstrap.
Day 8:
15.List out error code with explanation’
16.Create a models.py with atleast 6 different fields and foreign key.
Day 9:
17.List out 3 orm queries with example.

You might also like