Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Python provides the feature to divide large program
into different smaller modules
...
Functions are the most important building blocks for any
application in Python and work on the divide and conquer
approach
...
Program handling becomes easier: Only a small part of the program is dealt
with at a time
...
Reduced lines of code: While working with functions, a common set of code
is written only once and can be called from any part of the program which
reduces lines of code and programming overheads
...
Easy updation: In case a function is not used in a program, the same set of
code which is required in multiple programs has to be written repeatedly
...
With function, however, it is required to make
changes to only one location (which is the function itself)
...
Python has many
useful b functions to make programming easier, faster and
more powerful
...
A) Type conversion functions
Python provides built-in functions that convert values from one
type to another, which termed as type conversion functions
...
However, if we give
a string value a argument to int(), it will generate an error
...
0
...
float(); float converts integers and strings into floating point
numbers This function treats different types of parameters as
explained below:
If the argument is a number, float() returns the same number as a float
...
float(26) returns 26
...
76) returns 21
...
>If the argument is an expression, the expression is evaluated, and float()
returns its value
...
0, and float(12+3/4)
returns 12
...
14159') returns 3
...
If the string argument contains any character other than leading +/- sign and
floating point number in the correct format, then float() results in an error
...
It provides the most common way to
gather input from the keyboard
...
eval(): This function is used to evaluate the value of a string, eval()
takes a string as an argument evaluates this string as a number,
and returns the numeric result (int or float as the case may be)
...
ReplyForward