This example shows how to embed variable in a string. Variables can be Embed in a string by using specialize format sequence and then putting the variable at the end with a special syntax.
This example shows how to embed variable in a string. Variables can be Embed in a string by using specialize format sequence and then putting the variable at the end with a special syntax.
sometimes you may need to perform conversions between built in types. To convert types use the type name as function.
A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists.
int( x )- Convert a number or string x to an integer, or return 0 if no arguments are given.
float( x )- Convert a num-string(should contain decimal number) or a number to floating point.
isinstance(object, class)
Return True if the object argument is an instance of the class argument. If object is not an object of the given type, the function always returns False.
len( s )
Return the length (the number of items) of an object. The argument may be a sequence (string, tuple or list) or a mapping (dictionary).
The Python interpreter has a number of functions and types built into it that are always available.
lambda is an anonymous (unnamed) function. It is used primarily to write very short functions.