Your Excellent First Program In Python

Hey, Pythonistas🙋‍♀️ welcome back, hope you all are doing well. So, after knowing🧐 what’s python, installing it, and getting your coding environment ready. the next step is to write your first line of code. Your excellent First Program.

Excited🤩??

Well, I am.

You have a variety to choose from for writing your code:

  • Use python IDLE that comes with python: interactive mode;
  • Use python IDLE to execute a python file that you created;(python file means any file that contains python code and a .py extension(the file name ends with .py)usually): script mode;
  • Use some code editors(A code editor is a text editor that is specialized for writing software.) say notepad, notepad++, vs code, pycharm, etc;
  • Use it on your android device.

To get your hands on them click here.

In this post, we will together write your excellent first program in python. Let us get our hands dirty🖐👨‍💻 with python.

Typing Your Excellent First Program🎉

Open the file that you created in VS Code or any development environment of your choice. And then type the following line in there:

print("I love python")

Now click on the run button and I love python will be printed as the output.

Output:-

I love python

Here I love python is a string in python…

String: a combination of letters and special characters enclosed inside single or double quotes.

The print is a function.

A function: when written with parenthesis they perform some action.

The print function has taken string as its argument.

Argument: a value that a function takes inside of the parenthesis to perform the action it’s meant to perform.

More on print, strings, and arguments later on.

You all might be a bit confused😵(ok maybe baffled🤯❓) because these terms are new to you. But, no need to worry you’ll be good😇 to go with these terms after you finish 9-10 posts.

Don’t you feel like it’s not☹ something excellent and exciting🤩?

You are right✅✅, we will add one more line of code to make this an excellent first program.

Go on to the file again and type this line of code in the next line:

import antigravity

And run the program using the run button again.

After printing the string, python will open a website on your default browser.

This website contains a number of comics💭 to be read.

Antigravity is a built-in (comes with python installation) module in python.

To use any module in our python program we need to use the keyword import.

That is why we wrote import antigravity to use this library’s functionality.

**make sure ⚠ you are connected to the internet.

Your excellent first program in python
Code
Your excellent first program in python Output
Output

I’ll see😲you all in the next post till then enjoy reading 📖 your comics 💭.

Click here to directly read comics💭.

Hope you enjoyed reading this.

Conclusion

In this post, we saw where can you write python code depending on your requirements.

Along with it we together wrote an excellent🤩 first program in python.

This program led you to a comic💭 book online.

Challenge🧗‍♀️

Comment your first program below.

>>The challenge question for you is to print your name and age using the print function.

Once you are done doing that put a hash/pound/octothorp “#” before both the lines and run the program once again and see what’s changed and guess🤔 why did that happen.

Go fast. I am waiting. Comment your answers below.

See you in the next post till then have a great time. Bye bye👋😊

Leave a Reply

This Post Has 2 Comments

  1. Cyber

    Love it

  2. Maitry

    Thank You!