Posts

learnpython24-(How to Get Started With Python?)

Image
PYTHON INTRODUCTION How to Get Started With Python? In this tutorial, you will learn to install and run Python on your computer. Once we do that, we will also write our first Python program. Python is a cross-platform programming language, which means that it can run on multiple platforms like Windows, macOS, Linux, and has even been ported to the Java and .NET virtual machines. It is free and open-source. Even though most of today's Linux and Mac have Python pre-installed in it, the version might be out-of-date. So, it is always a good idea to install the most current version. Downloading Python and Pycharm Installation In this tutorial, we'll download and install Python as well as an IDE called PyCharm. First of all, let's head to Python's official website and download Python: Go to this link -  https://www.python.org/downloads/ . From the above link, download the latest version of Python. After visiting this link, click on the "Download Python" button. Your

learnpython24-(Using Modules & Pip In Python)

Image
  Using Modules & Pip In Python Sometimes we have to use someone else's code in our program because it saves us a lot of time. Today, we will learn a technique to use code that is not written by us but will enhance the quality of our program, save us time, and of course, it is legal and free. Let us understand what utilities like modules and pip are, Module  – Module or library is a file that contains definitions of several functions, classes, variables, etc . which is written by someone else for us to use. Pip  – Pip is a package manager for Python i.e., pip command can be used to download any external module in Pytho n . It is something that helps us to get code written by someone else from somewhere. We can install a module in our system by using pip command : Open cmd or Powershell in your system. And then, type pip install module_name and press enter. Once you do that, the module will start downloading and will install automatically on your computer. Example, for install

learnpython24.-(first python program)

                FIRST PYTHON  PROGRAM Writing Our First Python Program Today we will be writing our first program in Python Language. I know you were waiting to do this for long. Let's get to business and start writing our first python program. Follow the below steps: Open Pycharm and create a new file in it. Keep in mind the file name should not match any module name. After creating a new file, type print("Hello World") And then run your program. You will get the output as "Hello World." So, this is our first python program, and in this program, we just used a print function. In this function, whatever we pass in parenthesis () in a double quote or single quote gets printed (as it is) on the screen. Make sure you have written and executed the below code to get a feel of what it looks like! print ( "Hello world!" ) Previous Tutorial:             Next Tutorial:

learnpython24-(Python Keywords and Identifiers)

  Python Keywords and Identifiers In this tutorial, you will learn about keywords (reserved words in Python) and identifiers (names given to variables, functions, etc.). Python Keywords Keywords are the reserved words in Python . We cannot use a keyword as a variable name , function name or any other identifier. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive . There are 33 keywords in Python 3.7. This number can vary slightly over the course of time. All the keywords except   True ,  False   and  None  are in lowercase and they must be written as they are. The list of all the keywords is given below. False await else import pass None break except in raise True class finally is return and continue for lambda try as def from nonlocal while assert del global not with async elif if or yield Looking at all the keywords at once and trying to figure out what they mean might be overwhelming. Python Identifiers An identifier is

learnpython24-(Python Statement, Indentation and Comments)

Image
  Python Statement, Indentation and Comments In this tutorial, you will learn about Python statements, why indentation is important and use of comments in programming. Python Statement Instructions that a Python interpreter can execute are called statements . For example,  a = 1  is an assignment statement.  if  statement,  for  statement,  while  statement, etc. are other kinds of statements which will be discussed later. Multi-line statement In Python,   the end of a statement is marked by a newline character .  But we can make a statement extend over multiple lines with the line continuation character (\) . For example : a = 1 + 2 + 3 + \ 4 + 5 + 6 + \ 7 + 8 + 9 This is an explicit line continuation. In Python, line continuation is implied inside parentheses  ( ) , brackets  [ ] , and braces  { } . For instance, we can implement the above multi-line statement as: a = ( 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 ) Here, the surrounding parentheses  ( )  do the