Skip to main content

Posts

Comments, Escape Sequences & Print Statement

  Comments are used to write something which the programmer does not want to execute. Comments can be written to mark author name, date when the program is written, adding notes for your future self, etc. Comments are used to make the code more understandable for the programmer. The Interpreter does not execute comments. There are two types of comments in Python Language -: Single Line Comment Multi-Line Comment Single Line Comment : Single Line comments are the comments which are written in a single line, i.e., they occupy the space of a single line. We use # (hash/pound to write single-line comments). E.g., the below program depicts the usage of comments. import os #This is a comment print ( "Main code started" ) #Now I will write my code here: print ( os . listdir ( ) ) Copy Multi-Line Comment : Multi-Line comments are the comments which are created by using multiple lines, i.e., they occupy more than one line in a program. We use ' ' '….. Comment ….'
Recent posts

Using Python As A Calculator

  First of all, I would like to tell you one thing - the main motive of using Python is not to do raw calculations. You will perhaps never use python to calculate 3+8 or 34*232 for that matter. Yeah, that’s true! Python is not just limited to do calculations. It has a vast number of uses and has many merits or advantages. Using Python you can do most of the things, such as creating games, apps, software, websites, etc.  To do calculations in Python, open Windows PowerShell (or terminal of your choice if you are on Linux or Mac) and type, "python" to open the Python interpreter. You will see a screen like this: Then simply type or put whatever mathematical calculation you want to do. 5+9, 6-9 choice is all yours! When you type python, you are inside an interactive python shell where you can type anything and the value is displayed on the screen after the computation. That's how you can use python as a calculator. And that’s how you can easily do any type of mathematical ca

Writing Our First Python Program

  Today we will be writing our first program in Python Language. I know you are waiting from long to do this. 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" ) Copy Now run your program. You will get the output as "Hello World" in your terminal. So, this is our first python program, and in this program we just used print function. In this function, whatever we pass in parenthesis () in a double quote or single quote gets printed (as it is) in the terminal. Make sure you have written and executed the below code to get a feel of what it looks like! print ( "Hello world! I am learning Python" ) So, that's all in this tutorial. See you in the next one, where we will see how to use python as a calculator! 

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 energy, 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 Python. It is something that helps us to get code written by someone else. 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 installing flask I will do this: After pressing th

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 download will start as soon as you click the button Nice! You can run the installer and install Python. Now, Let's download Pycharm. But what is Pycharm, and why do we need it? Pycharm  is one of the best Integrated Development Environments (IDEs) for Python Language developed by the Czech company JetBrains. To download Pycharm, follow the steps below: Go to this link -  https://www.jetbrains.com/pycharm/download/#section=windows . After visiting the above link, download the community version of Pycharm. Click on the community button to download it. Your download will start. After that, install it like any other softwa

What Is Programming and Why Python?

  Guido Van Rossum created the Python Programming language in February 1991. Python is an interpreted, high-level, general-purpose programming language. Python allows us to create a game, build web apps, do general-purpose scripting, etc. Before we dive into the details of Python, let's understand what the term Programming or Coding means? Programming helps human beings to reduce hours of manual efforts. In today's era, demand for programming is growing rapidly; i.e., there is a huge need for software developers and programmers in IT (Tech) Industries. To write code on any language, we need a friendly platform where we can write the code and can execute it. For this, we use IDEs. IDE – An IDE (Integrated Development Environment) is a software application that provides many comprehensive facilities to programmers for software or application development. Python is used by many of the best tech companies. Few of those companies are: Instagram Facebook Google Reddit Spotify Quora D

Beginner Friendly Full Python Tutorials(Teaser) | Python Tutorials For Absolute Beginners

  Python is one of the most famous and recent Programming Languages.  I took this initiative of starting this course as I always wanted to make it easy for people to learn Python. On top of that, I got a lot of requests to teach Python in depth. In this course, we will be learning Python from the very beginning to the advanced level, where we will be doing projects like Jarvis desktop assistant and an Indian Railways announcement system. Most importantly, I will be giving some quizzes and exercises to test your skills regularly. I will be providing questions, and then you have to try solving them. This Python tutorial will enhance your programming skills, and it will also help you become a pro programmer.  Technology is enhancing, and human beings always try to reduce their manual efforts. After learning Programming, one can reduce his/her manual efforts to accomplish his/her work on the machine.  Programming allows us to minimize manual work. With the help of programming, we can make