Code Pumpkin

Hello world in Pycharm

October 1, 2018
Posted by Dipen Adroja

In the previous tutorial, we have installed python and pycharm. In this tutorial, we are going to create our first program in python language. I will be using my Mac during this tutorials. The same steps can be followed with minor tweaks if you are using other OS. We will create first `Hello World` program in PyCharm IDE.

First “Hello world” Program:

  1. Open Pycharm and click on “Create New Project”

Pyacharm Create new project

  1. Provide the location where you want to create the project. Pycharm will find the python interpreter you have installed earlier.

    PyCharm Create Projects

  2.  Right click on project name => New => Python File

    Give name “hello_world” and click OK
     

    Create Python File | Hello word in Pycharm

  3. Write simple program -> print(“Hello World!!!”)

    Hello World!! | Pycharm

  4. Go to Run=> Run and then select the file name

    Run Python File | Hello word in Pycharm

  5. Check the output into the run console. We can see the output “Hello World!!!”

    Hello World Output | Pycharm

Now, what if you don’t have pycharm sad. We can still run python from the terminal as well.

Go to the directory where the python file is located. Then run 


Python hello_world.py

It will produce the output as below laugh
 

Terminal hello world

Apart from this, you can also use python in interactive mode as below:

Interactive Hello World

Congratulations!!!! 

You have successfully ran your first python program.

That's all for this topic. If you guys have any suggestions or queries, feel free to drop a comment. We would be happy to add that in our post. You can also contribute your articles by creating contributor account here.

Happy Learning 🙂

If you like the content on CodePumpkin and if you wish to do something for the community and the planet Earth, you can donate to our campaign for planting more trees at CodePumpkin Cauvery Calling Campaign.

We may not get time to plant a tree, but we can definitely donate â‚ą42 per Tree.



About the Author


Coder, Blogger, Wanderer, Philosopher, Curious pumpkin



Tags: ,


Comments and Queries

If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code class="java"> 
String foo = "bar";
</code></pre>
For more information on supported HTML tags in disqus comment, click here.
Total Posts : 124
follow us in feedly

Like Us On Facebook