Skip to main content

Simple python programming

In this tutorials we are going to learn about the simple program on python.





  • Hello world program

In this program we use print command to print the hello world.
code: 
print("Hello, World!")


output:
Hello, World!


  • Add the two numbers
In this program we will ask the two number from user,sum it and print the result.
lets assign the first number by a and the second number by b
code :

print("enter the two numbers:")
a = int(input("enter first number: "))
b = int(input("enter second number: "))
sum = a + b
print("sum:", sum)

Output:
enter the two numbers
enter first number: 25(say)
enter second number: 25(say)
sum: 50

 a is the first entered  number  and b is the second entered number and sum is  a + b. at last the result is displayed by print which is same as hello world.
   

Popular posts from this blog

warm clothes distribution program

‘ Small step can make a big difference ’ Rural Women Development Centre from morang,Nepal distributed the warm clothes to the needy people. They manage it possible by collecting fund from working staffs and management committe. Here is the video link of the distribution program. https://youtu.be/AxaHbivcQUM

SMPS of computer

                                            fig:- working principle of SMPS       fig :- SMPS of computer From the above figure, we came to know that the function of SMPS in computer which is to convert  the high 220V-AC to 0-12V DC.SMPS contain several color of wires which carry the different voltage to the different parts of the computer.The following table shows the different color cables and its carrying voltage.      

Multiple mcp23017 interfacing with Arduino

MCP23017 is the I/O port extender that runs on 12C. It is 16-bit I/O expender.in this tutorial we are going to interface the single and multiple  mcp23017 with arduino.  fig:- mcp32017 module IT has 16 I/O ports from PA0 to PA7 and PB0 to PB7. first of all we are going to interface the single mcp23017 with Arduino. For this  connect the circuit as shown on figure. Download the library for mcp23017  from  sketch-- include library -- manage libraries.