Skip to content

Commit 6cf1f04

Browse files
Add files via upload
1 parent b6e5e73 commit 6cf1f04

12 files changed

Lines changed: 114 additions & 0 deletions
455 Bytes
Binary file not shown.
461 Bytes
Binary file not shown.

6th Day/actual_calculator_file.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# here we call all the function of module file togther
2+
from cal_part_one import *
3+
# here we call one by one all the functions
4+
from cal_part_two import mul
5+
from cal_part_two import div
6+
7+
f = int(input("Enter the value :"))
8+
s = int(input("Enter the secoond value : "))
9+
10+
11+
add(f,s)
12+
result = sub(f,s)
13+
print("The subtraction of both the number is:",result)
14+
mul(f,s)
15+
result = div(f,s)
16+
print("The divsion of both the number is:" , result)

6th Day/cal_part_one.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#calculatore 1st part add
2+
def add(a,b):
3+
c = a+b
4+
print("The adittion of both the number is:",c)
5+
6+
# calcutor 2nd part subtraction
7+
def sub(a,b):
8+
return a-b

6th Day/cal_part_two.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#calculator 2nd file with 3 part of code multiplication
2+
def mul(a,b):
3+
c = a*b
4+
print("The multiplication of both the number is:",c)
5+
6+
#calcutor 4th part code of divison
7+
def div(a,b):
8+
return a/b

6th Day/function_with_paramters.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# creating function and giving them parameters
2+
# code of block of function a
3+
def a(a,b):
4+
c = a+b
5+
print("The addition of both the number is:",c)
6+
7+
8+
#normal code function calling in file
9+
a(5,6)
10+
11+
def s(msg):
12+
print(msg)
13+
14+
m = input("Enter any msg you want to print")
15+
s(m)

6th Day/function_with_retrun.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#creating a function with retrun
2+
"""
3+
void , int ,and etc
4+
return
5+
"""
6+
def sub(a,b):
7+
return a-b
8+
result=sub(8,2)
9+
print(result)

7th day/indexing_of_string.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#indexing of python string
2+
name = "Welcome"
3+
"""
4+
W = 0 , -1
5+
E = 1 , -2
6+
L = 2 , -3
7+
C = 3 , -4
8+
O = 4 , -5
9+
M = 5 ,-6
10+
E = 6 , -7
11+
"""
12+
13+
print(name)
14+
#positive indexding
15+
print(name[0])
16+
# negative indexing
17+
print(name[-4])
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pattern printing in string using string slicing and negative indexing
2+
word = "computer"
3+
4+
for i in range(-1 , -len(word)-1 , -1):
5+
print(word[i:])

7th day/string_opertations.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#string operations
2+
#conctenation
3+
f_name = "ramlal"
4+
l_name = "sharam"
5+
print(f_name+l_name)
6+
7+
#repetation
8+
laugh = "ha"
9+
print(laugh*5)
10+
11+
#looping
12+
word = "Code"
13+
for i in range(5):
14+
print(word)

0 commit comments

Comments
 (0)