Creating Your First Python Program
In the last tutorial, we completed our Python installation and setup. It's time to create your first program
Creating First Program
Step 1) In Aptana Studio write the command
print("Hello World")
Step 2) Save the file as HelloWord.py in folder "Guru99."
- Select the folder "Guru99" where you want to save the .py file
- File saved with title "HelloWorld.py". Make sure you add .py extension to each and every file
When you save the file, it will automatically show in your Aptana Studio Project Explorer
Step 3) Execute the code using the following steps
- Right click on the file that you want to run your code
- Click on the green run button on top of the main menu and select "Run As"
- Click on Python Run
Step 4) The output "Hello World" of the code is seen in the console
Step 5) Don't worry if you don't have Aptana Studio or an editor installed, you can still run the code from the command prompt.
The output of the code would be
Comments
Post a Comment