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.