Decision making in Python

Prediction of conditions in a program and specifying actions to be taken for each condition is called decision making.Python evaluates expressions  that give True or False as output. For example, if your score in Mathematics exam is above 90, then your grade is A. If your score is greater than 80 and less than 90,... Continue Reading →

User Defined Functions

A function is nothing but a piece of code that does some task. This piece of code can be reused whenever required. Functions are of 2 types : 1. Built in functions 2. User Defined Functions. Built in functions are those that are inbuilt and come as a part of a python library. User defined... Continue Reading →

Tools to write Programs

We have seen the basics of Python in the previous blogs. Hope you have followed the previous blogs. Now let us see how to write programs and let us look at things that need to be noted while writing programs.  A python file has a .py extension. For example: myfirstprogram.py     If you are using... Continue Reading →

Loops

We have learnt about strings and lists. Now let us learn about loops. We use loops when we have to perform a particular action repeatedly. There are two types of loops in python- For loop and while loop. For loops iterate over a given fixed number of elements in a fixed definite sequence.    In... Continue Reading →

Python Lists

We have learned to use numbers and strings in Python. Now let us learn about lists. A list is a compound data type in Python used to group data together. It is a sequence of comma separated values written in square brackets where each element of the sequence is assigned an index. The first index... Continue Reading →

Strings in Python

Strings are important in Python. Python has no character type. Hence characters are expressed as strings of length 1. Strings are expressed in single quotes or double quotes. Both are the same in Python.  String literals can span across multiple lines. One way is using triple-quotes: """...""" or '''...'''. Strings can be concatenated  with the + operator, and... Continue Reading →

Play with numbers

Lets start our first lesson in Python. Python makes calculations easy. Let's check it out. First check if IDLE icon is present on your Desktop. If not, click on the Windows Button and type IDLE in the search bar at the bottom of the screen. Right click at IDLE and select open file location. Copy... Continue Reading →

Installing Python

  The latest Python version is Python 3.6.3. Let us go ahead and install it for Windows 10. The steps required are: Go to https://www.python.org/downloads/windows  and under Python 3.6.3 - 2017-10-03  click on Download Windows x86-64 executable installer. A  zip file python-3.6.3-amd64.exe will get downloaded. Double click on the downloaded file and a Python 3.6.3 (64-bit) Setup Box opens. It looks like... Continue Reading →

Why Python?

Python is an interpreted language -You don't have to compile the code before execution. Python is a dynamic language - Dynamic means that the type of a variable is not set and can change throughout the program execution. This makes the code small and flexible. Python is  a high level programming language -  This means... Continue Reading →

Powered by WordPress.com.

Up ↑