Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected typo in README #384

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ For example, if you wanna add a solution for problem 0001, you should do like th
* cd `YOU_GITHUB_USER_NAME`.
* mkdir `0001`.
* cd `0001`.
* and the write some code & test it.
* and then write some code & test it.

If all these steps done, send us an pull request. After we accept your request, we'll invite you to this group.
63 changes: 63 additions & 0 deletions noviicee/0001/calculator_advanced.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#advanced calculator
#a calculator with some more advanced features..
#it will work until we exit the calculator

import sys
#define functions for the advanced calculator-
def add(x,y):
return (x+y)

def subtract(x,y):
return (x-y)

def multiply(x,y):
return (x*y)

def get_modulus(x,y):
return(x%y)

def float_divide(x,y):
return (x/y)

def floor_divide(x,y):
return(x//y)

#take input from the user
while True:
choice=int(input("""Select Operation:\n
1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6.Divide and get the integer value
7. Exit\n\n"""))
if choice == 1:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"+",num2,"=", add(num1,num2))
elif choice == 2:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"-",num2,"=", subtract(num1,num2))
elif choice == 3:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"*",num2,"=", multiply(num1,num2))
elif choice == 4:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"%",num2,"=", get_modulus(num1,num2))
elif choice == 5:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"/",num2,"=", float_divide(num1,num2))
elif choice == 6:
num1 = int(input("Enter first number: \n"))
num2 = int(input("Enter second number: \n"))
print(num1,"//",num2,"=", floor_divide(num1,num2))
elif choice==7:
sys.exit(0)
else:
print("Invalid input.")
print("Try Again...")
136 changes: 136 additions & 0 deletions noviicee/0001/result_output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
TESTING$calculator_advanced.py
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

1
Enter first number:
12
Enter second number:
32
12 + 32 = 44
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

2
Enter first number:
12
Enter second number:
32
12 - 32 = -20
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

3
Enter first number:
12
Enter second number:
32
12 * 32 = 384
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

4
Enter first number:
36
Enter second number:
5
36 % 5 = 1
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

5
Enter first number:
78
Enter second number:
4
78 / 4 = 19.5
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

6
Enter first number:
78
Enter second number:
4
78 // 4 = 19
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

12
Invalid input.
Try Again...
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

233
Invalid input.
Try Again...
Select Operation:

1.Add
2.Subtract
3.Multiply
4.Get the Remainder after division
5.Divide
6. Divide and get the integer value
7. Exit

7

TESTING$calculator_advanced.py