Posts

Python3 Standard Input and Output

Python Standard input and output STANDARD INPUT AND OUTPUT Python Output :              We use the print() function to output data to the standard output devices.            eg:                    print("HELLO WORLD")           output:  HELLO WORLD   eg:        a=20               print("The value of a is ",a)               print("The value of a is "+ str(a))         output:  The value of a is 20                       The value of a is 20   OUTPUT FORMATING :   eg:      a=10;b=30             print("The value of a is {} and b is{}".format(a, b))         output:   The value of a is 10 and b is 30     eg:      a=10;b=30              print("The value of b is {1} and a is {0}".format(a, b))        output:    The value of b is 30 and a is 10     eg:         print("Hello {name},{greeting}".format(name="Suma", greeting="Good Morning"))         output:    Hello Suma, Good Morning   eg:         print("the stor

Python3 Data types 2

Python Data types 2. PYTHON LIST : List is an ordered sequence of items. It is most used datatype in Python and more Flexible.     *  Declaring a list is, items Separated by commas( , ) are enclosed within brackets [ ].   eg:       a=[10,'hello',10.3]              print(a[1])                 #print index element                        output: 'hello'  *  Lists are mutable ,meaning ,elements in a list can be altered.     eg:     a=[21,30.3,'list']             print(a)             a[1]=3.3             print(a)            output:     [21,30.3,'list']                       [21,3.3,'list'] For more information suggested video  https://youtu.be/e1ruxK_6XZY PYTHON TUPLE :      Tuple is an ordered sequence of items same as list. The only difference is that tuples are immutable, Tuples once created cannot be modified. Declaring a tuple ,elements are separated by commas( , ) and enclosed within parentheses  ( ).    eg:       b=(10,2.5,'tuple')  

Python3- Data types1

Image
Python DATA TYPES:-         In python, every value has a datatypes. Everything is the object in python programming, datatypes are actually classes and variables are instances(object) of these classes.        1. Numeric         2. Boolean        3. Sequence type               1.Strings                2.List                3.Tuple        4. Set        5. Dictionaries.                                                                        NUMBERS(NUMERIC):-            In this numeric values are stores in variables which are immutable  (the values assigned to a variables can be changed).           *  Integers(int) ,float point numbers(float)  and complex numbers(complex) are involved in this.                      * type() function  used to know which class a variable or value belongs to .           * isinstance() function used to check if an object belongs to particular class or not.            * complex() function used to convert integers to complex       eg:-         1.               

Python 3 -(2) Values and Variables

Image
Python VALUES :-      Basically values are the digits or letters used in python to perform certain task.      These values has different types:                       1.integer type(int)                               eg:-   2,5                       2.floating point type(float)                             eg:-    3.0,2.0                       3.string                             eg:-    hello everyone ! VARIABLES :-                Variable is the location in memory used to store some data (value) or simply,a name that refer    to value.             * The rules of representing a variable is same as writing identifiers.      * In python,we even don't have to declare the type of the variable,it will handle internally according to the type of value which we assigned to the variable.    VARIABLE ASSIGNMENT:-                          We use assignment operator(=) to assign a value to variable.           eg :- 1.   a=34                  #here a is a variable and 34 is a value(int) .  

Python3

Image
WHY PYTHON?      *Basically python is general purpose ,high level,interpreted language .         *Very simple language to learn.      *It has best packages for AI,deep learning,machine learning etc...      *It also has very interactive frame work that is ipython notebook .      *Extensively used in industry  Features OF PYTHON:-                   *simplicity                    *open source language- free for everyone 👯👫                    *portability-code sharing much easier   💯                                     *Embeddable and extensible                   *interpreted line by line (CPU and Memory Management)                   *huge libraries (Numpy , Matplotlib , Scikit-learn)                   *object oriented PYTHON  KEYWORDS(🔑) :                               keywords are reserved words.                              In python, there are 35 keywords.                      # get all keywords in python                  >>> import keyword             >>> print(