Python Notes
Python Notes
Python Notes
2. Features of Python-: Simple, Easy to learn, Open Source, High level language,
Dynamically typed, Platform Independent, Portable and procedure and Object
oriented.
2. Assignment Operators-: These operators are useful to store the right side value
to left side variable like assignment operator(=), addition assignment
operator(+=), substraction assignment operator(-=), multiplication assignment
operator(*=), division assignment operator(/=), modulus assignment operator(%=),
Exponent assignment operator(**=) and floor division assignment operator(//=)
5. Boolean Operator-: Boolean operator act upon 'bool' type literals and they
provide 'bool' type output. It means the result provided by boolean operator will
be again either true or false. (and, or, not)
4. print()-: We can display the values of variables using the print() function. A
list of variables can be supplied to the print() function.
5. .format()-: After format string, we should write member operator and then
format() method where we should mention the values to be displayed.
6. Input Statement-: To accept input from keyboard, python provides the input()
function. This function takes a value from the keyboard and returns it as a string.
7. split() Method-: The split() method by default splits the values where a space
is found. Hence, while entering the numbers, the user should separate them using a
space. The square brackets [] around the total expression indicates that the input
is accepted as elements of a list.
8. eval() function-: The eval() function takes a string and evaluates the result of
the string by taking it as a python expression.
For Example-: Let's take a string 'a+b-4' where a as 5 and b as 10 if we pass the
string to the eval() function, it will evaluate the string and returns the result.
9. round keyword-: it will take decimal value. for example, you want to take only
two decimal value [round(value, 2)].
10. append-: adds a single element to the end of the list. for example,
list.append(element)
11. class -: It is a user defined data type. Those classes are defined by user, is
called user defined classes. If you want to re-use the program, simply you can
create a class and call it again and again.
12. append method -: append method is used for add the new value in existing array
in the end of indexing of array.
13. sep= -: Add space, special character, number, alphabate and anything between
sentence, digit, etc. like 09-10-2000, A B C and so on
for example -> print('python','is','programming','language' , sep='-')
14. end= -: Add space, special character, number, alphabate and anything at the end
of the word, character, sentence, etc
for example -:
16. min() -: The min() function returns the item with the lowest value, or the item
with the lowest value in an iterable. If the values are strings, an alphabetically
comparison is done.
17. max() -: The max() function returns the item with the highest value, or the
item with the highest value in an iterable. If the values are strings, an
alphabetically comparison is done.
19. map() -: map() function returns a list of the results after applying the given
function to each item of a given iterable (list, tuple etc.)