Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways

Hello World | Python for Data Science | Day 2

Hello Pyfans! 
In the previous article, we discussed Python installation. Now it’s time for us to dive into the code. For any programming language, the very first program is “Hello, World!”. The famous “Hello, World!” program is used to illustrate the basic syntax of a language.  So, let’s acquaint ourselves with the environment and write our first line of code in Python to embark on this incredible journey of learning!

For this article, we will be using IDLE to write our first Python program. 

STEP 1: As we demonstrated in the previous tutorial, IDLE is automatically installed when you download Python. If you have trouble finding IDLE, just type IDLE in the Start menu’s Search bar and hit enter. 

STEP 2: When you click on IDLE in the search results, the Shell screen will appear as displayed below.

STEP 3: Click on File in the Menu Bar and select New File. The untitled screen shown below will appear. This is the space where we will type the code.

STEP 4: Now type the following line of code:

print(“Hello, World!”)

The line, when typed, will appear as shown below:

STEP 5: To run the file, hit the F5 key on the keyboard. The following pop-up box will appear.

STEP 6: Click OK. Give a name to your file and save it in your preferable location on the computer. 

STEP 7: As soon as you click “Save”, the following Shell window will appear with your output.

Congratulatulations! With this tutorial, you have written your first line of code in Python. All the adventure starts with the first step.

A brief about the print statement:

In Python, the print() function is used to print content on the console. Let’s identify its structure.

                         print(“Hello World!”)

The contents of the brackets are the words to be printed on the console. These words are written within inverted commas. The print function is used for various purposes.

It can be used to display messages to prompt the user for entering inputs, displaying output, etc.

To learn more about the usage of print, you may also refer to https://www.w3schools.com/python/ref_func_print.asp

Follow us along your Python journey. We promise to make it super easy and fun for you 🙂

We have covered 40+ complete Data Science company interviews from the candidates who cracked these interviews.
Data Science Companies interview questions
We also have 30+ e-books on Amazon, Insta Mojo and books which can be delivered directly on your email address
Complete Set of e-books from The Data Monk
Understand some of the very complex topics in Analytics which are asked in most of the interviews
The Data Monk Top Articles
How to become a Data Scientist? Complete study material, free resources and websites to practice
Become a Data Scientist 
Make your profile on our website and practice at least 5-7 questions per day. Be a part of ~2000 Analytics expert

Article By,
Yashika Khurana
Intern | The Data Monk

About TheDataMonkGrand Master

I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience 3+ years at Mu Sigma 2 years at OYO 1 year and counting at The Data Monk I am an active trader and a logically sarcastic idiot :)

Follow Me

Leave a reply