-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from prabhus489/dev
Dev to master Release
- Loading branch information
Showing
9 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# To add all numbers in a collection | ||
def AddCollection(inputValues): | ||
sum = 0 | ||
for num in inputValues: | ||
sum +=num | ||
return sum | ||
#Python program to add two numbers using function | ||
|
||
# To add two numbers | ||
def AddTwoNumbers(num1, num2): | ||
return num1 + num2 | ||
def add_num(a,b):#function for addition | ||
sum=a+b; | ||
return sum; #return value | ||
num1=int(input("input the number one: "))#input from user for num1 | ||
num2=int(input("input the number one :"))#input from user for num2 | ||
|
||
print("The sum is",add_num(num1,num2))#call te function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,5 @@ def divide(x, y): | |
|
||
else: | ||
print("Invalid Input") | ||
|
||
# This is a comment being added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#python program to subtract two numbers using function | ||
|
||
def subtraction(x,y): #function definifion for subtraction | ||
sub=x-y | ||
return sub | ||
num1=int(input("please enter first number: "))#input from user to num1 | ||
num2=int(input("please enter second number: "))#input from user to num2 | ||
|
||
print("Subtraction is: ",subtraction(num1,num2))#call the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
def divNum(a,b):#function definision | ||
return a/b | ||
num1=int(input("Please input the number for num1: ")); | ||
#Ask and reading the input from user for num1 | ||
num2=int(input("Please input the number for num2: ")); | ||
#Ask and reading the input from user for num2 | ||
print("Division of given numbers is:",divNum(num1,num2)) | ||
#call the function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Python Program to find Power of a Number | ||
|
||
number = int(input(" Please Enter any Positive Integer : ")) | ||
exponent = int(input(" Please Enter Exponent Value : ")) | ||
|
||
power = 1 | ||
i = 1 | ||
|
||
while(i <= exponent): | ||
power = power * number | ||
i = i + 1 | ||
|
||
print("The Result of {0} Power {1} = {2}".format(number, exponent, power)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ def test_divide(self): | |
ct.test_subtract() | ||
ct.test_multiply() | ||
ct.test_divide() | ||
|
||
# This is a comment added by Raj |