Saturday, November 23, 2019

How to write code and run


Here we write some code of python. Do not worry you also able to write such code , first try to learn this , what the information carry in this code.


Open your Python Idle which I explain in my previous blog. Here the link: How to download and install python. When you click on File > New File. Then you see this tab and here write this code.


Step 1: Write the code here and Now click on Run option


Code:

temp= eval(input('Enter a temperature in Celsius:'))
print('In Fahrenheit, that is', 9/5*temp+32)




If you worried here, what is eval stand for and why we use input in this code, then don't worry it only example to show you how code work. In further post I explained everything.


Step 2:- Now click on Run Module(F5) and for shortcut press F5 from your keyboard.





Step 3: Now click on OK option




Step 4: Now give name to this file and save where you want to save this file and click on save.






Step 5: After save, A new tab appear where it ask to "Enter a number in  Celsius ": 5 (When you press 5 and then press Enter)






Step 6: Then automatically you see the result of this : In Fahrenheit, that is 41.0





This is the basic programmed of the Python language and by follow all these steps you able to get the result of your code. Keep on update on this blog and you learn python from basic to advance.

Hope you like and understand the tutorial.

If you have any query then drop a comment in the comment box, I try my best to explain you.


No comments:

Post a Comment

If you have any doubt, let me know.

How and Why you should learn python? About Python Programming Language Python is the programming language. By the help of Python you can ...