Skip to main content

Hello World : Creating our first python program

HELLO WORLD! Create first python program 
In our previous tutorials we have seen the installation and setup of of Pycharm and IDLE

Saying Hello World! to Python


Now we will run our first program and see how to print hello world in python.


Step 1) Open your PyCharm Editor  and  click on "Create New Project"

Step 2)   You will need to select a location.
  1. You can select the location where you want the project to be created. If you don’t want to change location than keep it as it is but at least change the name from “untitled” to some other name .
  2. PyCharm should have found the Python interpreter you installed earlier.
  3.  Next Click the “Create” Button




Step 3) Now go to "File" menu. Select "New".Then select "Python File" 



Step 4) A pop-up will appear ,write the name of your Python File and hit enter.

Step 5)  Now type a simple program 
                 
                 print("Hello World")
                  
               You can use " " as well as ' ' .In python they both have same meaning




Step 6)  Click the  right mouse button.You will see a run option as seen in above image.Click the run option

Step 7)  A terminal will be opened and "Hello World " will be printed as shown in the image


Congrats! We have successfully ran our first program. In our next blogs we will try other programs




Comments

Popular posts from this blog

How to install python IDE ? IDLE and Pycharm

How to install Python IDE on Windows 10(Pycharm and IDLE)? Pycharm is the best Python IDE available.It comes with many in -built features. We will discuss its shortcuts in our next blogs.Pycharm is a cross-platform editor developed by jetbrains.   Installing Python Step 1) Visit the official website of python or click the below link              https://www.python.org/downloads/  .  Step 2) Click on Download Python               Step 3) After the download is complete ,open the exe file and click               on Install now  Step 4) After the successful installation it will show you a message         Setup was successful Step 5) Now go to your windows search bar and type "IDLE"              Press Enter and you will see that idle is opened Installing Pycharm St...

String Slicing in python

String Slicing Python  Slicing refers to extracting some words from a string. As in many other languages there are many different concepts for extracting a letters or words from a string ,in python we are having the concept of slicing. We can also the same things using looping, we will learn about it in our next tutorials. Indexing in Strings Before starting slicing, we need to understand the indexing in python. We have the concept of positive indexing  and  negative indexing.  Positive indexing starts from 0 to (length of string).It goes from forward to backward. Negative indexing starts from -1 to -(length of string + 1). It is illustrated in below example Below are some examples of how to use string slicing to extract characters from string. Accessing the characters in a string using positive index eg. string= "We are studying string slicing" s=string[ 0 ] # A single character will be printed present at index 0 w=string[ 4 ] # A...