Posts

Showing posts with the label programming

What is Python ?

Python is a popular "High Level Programming Language" Lets learn how it came about and what makes it so popular. According to the TIOBE (The Importance Of Being Earnest) community index, Python is currently ranked no. #4. Which is pretty high than the rest. The index is calculated taking various search engine results into account. Python is being used in various application areas such as : Web Development Scientific Computing Data Analytics and so on.... Python supports multiple programming paradigms including : Imperative Object Oriented Procedural Functional programming styles. It is also an Open Source Language. Many developers contribute towards its development. However, Guido van Rossum (BDFL) is the principle author. The Python community has affectionately given him the title of Benevolent Dictator for Life. The Design Philosophy of Python is summarized in a collection of 20 principles.Some of which are : Beautiful is better than ugly. ...

Using Variables

Image
In the last post, we saw how to print Hello World using the print() command. Now suppose you want to print your name with Hello World. Sounds interesting. But for that, you have to save your name at some location, that is where variables are used. Lets see an example : As you can see, 'anyname' is a variable used to take input from user. The input() command is used to take input from user. The user inputs his/her name and it is stored in 'anyname' Next is printing the name. So, in print() command, you can see  print("Hello World! This is", anyname) 'Hello World! This is' is written within inverted commas but not 'anyname' This is because 'anyname' is a variable that contains certain value inside it but the rest of it is a string. When the program is run, the output is Hello World! This is <name entered by user>

Simple Hello World Program Tutorial

Image
Now that you know how to use IDLE, lets begin with writing our first program. The Hello World Program ( We usually do this in every language 😎) Lets begin. Fire up IDLE. Go to File>New File. Once it opens up, write the code in the new file. print("Hello World!") Now click on Save As and save the file with .py extension. See the image below. Go to Run> Run Module or Press F5 to check whether the code is working or not. It works.