How to do Sum or Addition in python
Table of Contents
Syntax and Examples :
# Simply Adding
# By passinng value in variable directl
2)
a=5
b=10 print(“total sum of a and b is:”,a+b)
# Addinng by taking Input from User
3) x=input("enter value of x:")
x=int(x) # Type connversion
y=input("enter value of y:")
y=int(y) # Type connversion
z=x+y # Adding X and Y
print("sum of x and y is:",z)# Result of Sum
# Addition using While loop
# Here type conversing and taking input
#from user
total+=i
OUTPUT
Scriptspython.exe” “C:/Users/user/Python
EX/helloworld/sumOf_Multiple_Number.py”
1) sum is 9
enter value of y:8
sum of x and y is: 15
total sum is: 15
Process finished with exit code 0


Python Comment  Creating a Comment  multiline comment  example
 Python Comment  Creating a Comment  multiline comment  example
 Python Dictionary Introduction  Why to use dictionary  with example
 How to do Sum or Addition in python
 Python Reverse number
 find common number in python
 addition of number using for loop and providing user input data in python
 Python Count char in String
 Python Last Character from String
 Python Odd and Even  if condition
 Python Greater or equal number
 Python PALINDROME NUMBER
 Python FIBONACCI SERIES
 Python Dictionary  Items method  Definition and usage
 Python Dictionary  Add data , POP , popitem , update method
 Python Dictionary  update() method
 Delete statement , Looping in list In Python
 Odd and Even using Append in python
 Python  Simple Odd and Even number
How to do Sum or Addition in python
One comment on “How to do Sum or Addition in python”
[…] How to do Sum or Addition in python […]