Skip to content

Commit d2b2bae

Browse files
Add files via upload
1 parent 8e6bb5e commit d2b2bae

File tree

11 files changed

+62
-0
lines changed

11 files changed

+62
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#main.py
2+
from packages import add
3+
4+
print(add(10,5))
5+
6+
print('----------------------------------------')
7+
#importing all functions togther
8+
from packages import *
9+
10+
print(add(4,5))
11+
print(sub(3,2))
12+
print(reverse('Welcome'))
13+
14+
print('------------------------------------------')
15+
#taking input form users
16+
a = int(input('Enter first value:'))
17+
b = int(input('Enter second value:'))
18+
s = input("Enter text to inverse it")
19+
20+
print(sub(a,b))
21+
print(add(a,b))
22+
print(reverse(s))
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#module file in user define
2+
def add(a,b):
3+
c=a+b
4+
print("The addition of both the number is:" , c)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#in built module
2+
#math module
3+
import math
4+
num = 20
5+
print('Square root:', math.sqrt(num))
6+
print("Value of pi:", math.pi)
7+
print("factorial of 5:",math.factorial(5))
8+
9+
print('----------------------------------------------------')
10+
11+
#calling many modules togther in one line
12+
import math , random
13+
num = random.randint(1,50)
14+
print("Randome number:",num)
15+
print("Square root:", math.sqrt(num))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from add import *
2+
3+
add(4,5)
4+
5+
#code for taking input from user
6+
a = int(input('Enter the value:'))
7+
b = int(input('Enter the second value'))
8+
add(a,b)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#__init__.py
2+
from .math_tool import *
3+
from .string_tools import *
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#my_package math_tool.py
2+
def add(a , b):
3+
return a+b
4+
5+
def sub(a ,b):
6+
return a - b

0 commit comments

Comments
Β (0)