- We will start with the simple if..else statement in Python.
- Create a new file ifelse.py and enter the below lines:num = 100
if (num == 100) : print(“Value of the number is 100”)
print (“Value of the number is not equal to 100”)print(“Exit”)
- Save the file and under Run menu, click on Run module. You should get the output as shown below:
All in One
- Next, we will see how to use the if, elif and else statements in one program.
- Type the code snippet as given below:
3. Save the file and under Run menu, click on Run module. You should get the output as shown below:
So, after installation of python, we need to update the environment variable PATH in windows 10.
- Click Windows + Pause, to start the System Properties and update the value for PATH as shown below:
2. Start your command prompt and type : PATH. This should now include the installation directory of Python.
So I have decided to learn two new languages in 2017, beginning 11th April 2017 . For quite a while I wanted to learn Python and ADF and this blog marks the beginning of the journey.
The first post was to install Python and write the Hello World program. I will write new posts as I learn more about these two languages.