Posts

Python data types

Image
 Python Data types Image credits: Geeks for Geeks In this tutorial we will learn about different data types in python with example Python numeric data type 1.  int 2.  float 3. complex int data type It is used store integers type(element) gives the data type of the element Example: Image credits: Programiz Output: Image credits: Programiz Float  data type It is used to store numbers which have decimal points Example: Image credits: Programiz Output:  Image credits: Programiz Complex data type It is used to store complex numbers Example Image credits: Programiz Output Image credits: Programiz String data type It is used to store a collection of characters Example: Image credits: Programiz Output Image credits: Programiz Remaining data types like list,set, dictionary etc...  are a little advanced topics which we will see in further tutorial Disclaimer : All the above images used in this blog are owned by respective owners. Please contact me for any removal ...

Variable declaration in python

Image
 Variable declaration in python Image credits: Google Variable is are used to store values in it. You can assume variable is a like a box and value is which you can store in the box Rules to declare variables and indentifiers Identifiers - Names to given variables, classes, methods etc... 1. Identifiers cannot be a keyword. 2. Identifiers are case-sensitive. 3. It can have a sequence of letters and digits. However, it must begin with a letter or _. The first letter of an identifier cannot be a digit. 4. It's a convention to start an identifier with a letter rather _. 5. Whitespaces are not allowed. 6. We cannot use special symbols like !, @, #, $, and so on. Declaring a variable in python Declaring variable a which a is the variable name and value 56 is stored in it And we don't need tell explicitly data type of our variable which will store that data type value Python will implicitly do it Output:   int means integer We can also change value in our variable Output: We can al...

Print function in python

Image
Print function in python Print function is a function which is used to display message to screen or standard output  The rules should be followed 1. Either we can use single quotes or double quotes Single quote Output: hello world Double quotes Output: hello world 2. Don't use different quotes (single, double) quotes to print string Output: 3. Single quote can be embedded in double quotes and vice versa Output: 4. In order to print name's like in single quotes we have to use \ that means to ignore next single quote  Output: All those above are possible printing ways in python Image credits: Programiz Disclaimer: All the above images used in this blog are owned by respective owners. Please contact me for any removal of images. No copyright infringement

Introduction to python

Image
 Introduction to python Image credits: Google In this tutorial we will learn about python language  When it comes to coding and programming we frequently listen python programming language as it is very famous. It was created by  Guido van Rossum in 1991 Python is used for 1.web development (server side) 2. Software development 3.Machine learning and artificial intelligence 4. Data science domain etc...... 5. Python can be used on a server to create web applications. 6. Python can be used alongside software to create workflows. 7. Python can connect to database systems. It can also read and modify files. 8. Python can be used to handle big data and perform complex mathematics. 9. Python can be used for rapid prototyping, or for production-ready software development. It is beginner friendly. Learning python is very easy when compared to c,c++,java etc... Because it's syntax is very easy than others. It has so many in-built functions and methods which made our work easy D...