The number of 6-digit even numbers that can be made from the number 214635 are:
.png)
Hope your enjoying my python series.
Today's topic is about Arithmetic operations , it includes below operations
Addition(+)
Subtraction(-)
Multiplication(*)
Division (/)
We will start with addition of two variables
So, declare two variables
a = 12
b = 34
print("addition of two numbers" ,a+b)
Program
Output:
Same as it as subtraction too, replace + by - and divison.
For multiplication use symbol called asterisk(*).
This is the addition of rwo variables(int) then we will move on to strings.
In strings , addition operation is called as concatenation . Move on to program
Sen = "blog writing " # declaring a string.
print(sen)
Output :Let me sh2ow me about concatenation of strings.
sen = "python is good"
sen2 = "and easy"
print(sen + sen2 )
Program
Output
As you can observe a there is no space between two words which we have added. To get the space between .
For the above code , edit print statement as given below
print(sen + " " + sen2)
Program
Output
This is the addition of strings . As we cannot substract and divide two strings. But ,we can print one string 'n' no .of . times .
S = "I love Allu Arjun"
print(s*3)
Screen shot :
Output :
This a end of this theory. Hope it helps you.
My fb page : PyAndroid
Comments
Post a Comment