FIRST PROGRAM IN PYTHON CODE IN PYTHON ("HELLO WORLD")

 Create a New Python Project – Hello World Application :


On the ‘Welcome to PyCharm’ window, you’ll find a ‘Create New Project’ option. Select this option.

pycharm create new project

Next, choose an appropriate name for your first project. I’ve named it “myFirstProject”. You can now choose the location where you want your project to live on the disk. I’ve left the default path.


create python project

PyCharms recognizes any existing Python installations. You can choose any one of the underlying options as your base interpreter for the project.

Click on the create option at the bottom right corner.

Create a Python File and run it

On the top left side of the Project window, you’ll see the name of your project. Right-click on the name and create a new Python file, in this file we will write the code to print hello world

create python program

To mark the beginning of our first python project in PyCharm, we’ll write our very “original” Hello world program!! It’s a tradition, you can’t escape it!

Choose an appropriate name for your file. I’ve named it “hello.py”.

python hello world file name

Start writing the python program to print “Hello World” in this file.

print("Hello world! - from DataFlair")

Execute Python Hello World Program

To run the file, click on the green play button at the top right side of the UI. Or press CTRL+SHIFT+F10 (or just SHIFT+F10, depending on the version).

execute python hello world program

The top box shows the code to print hello world and the bottom one shows the output for that code.

This Hello world program is really dull, right? Let’s customize it.

name = input()
if name == '':
print("Hello world! - from DataFlair")
else
print("Hello " + name + "! - from DataFlair")

.

Summary

In this tutorial, we created our first python program is hello world program in PyCharm.

PyCharm, and IDEs in general, tend to shine on larger projects. You’ll see many powerful features of PyCharm at work while writing heavy and complex codes.

There’s a reason why PyCharm is so popular among the Python programmers. With its syntax suggestions, type checking, debugging, etc, PyCharm will make your programming life so much easier.
Working with PyCharm might feel overwhelming at first. But you’ll learn little bits of the IDE as you go. Soon you’ll understand almost the entire IDE and you won’t imagine programming without it.

Comments

Popular posts from this blog

HANDWRITTEN NOTES (COMPUTER NETWORK ) USEFULL IN EXAMS (IMP TOPICS)

OSI MODEL IN COMPUTER NETWORK

SESSION LAYER IN COMPUTER NETWORK