-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpro_function&recursion.py
More file actions
127 lines (104 loc) · 2.56 KB
/
pro_function&recursion.py
File metadata and controls
127 lines (104 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# FUNCTIONS :
# def avg(): # function defination
# a = int(input("enter the no."))
# b = int(input("enter the no."))
# c = int(input("enter the no."))
# average = (a+b+c)/3
# print(average)
# avg() #functon call
# avg()
# print("thank you!!")
# avg()
# print("thank you!!")
# def gd(name,ending):
# print("good morning ," + name)
# print(ending)
# gd("adithya!!!","thanks")
# gd("bro!!!","thanks,thanks broo!!!")
# gd("vignesh!!!","thanks man!")
# def gm(name,ending):
# print(f"good morning , {name}" )
# print(ending)
# return "OK!"
# a = gm("ADITHYAN","thank you!!")
# print(a)
# def gm(name,ending="thank you"):
# print( "hi man!",name)
# print(ending)
# gm("bro")
# gm("i am fine","thanx")
# Recursion :
# def factorial(n):
# if(n==1 or n==0):
# return 1
# return n * factorial(n-1)
# n = int(input("enter the no. :"))
# print(f"this is factorial of {factorial(n)}")
# def fac(n):
# if(n==1 or n==0):
# return 1
# return n * fac(n-1)
# n = int(input("enter the no. :"))
# print(f"this is the value {fac(n)}")
# write the greatest of 3 no.
# def greatest(a,b,c):
# if(a>b and a>c):
# return a
# elif(b>a and b>c):
# return b
# elif(c>a and c>b):
# return c
# a = 43
# b = 33
# c = 55
# print(greatest(a,b,c))
# converting celsius to far
# def far():
# cel = int(input("enter the measurment of cel : "))
# far = (9/5*cel)+35
# print(f"the value of converting cel to far is {far} ")
# far()
# converting far to celsius
# def cel(f):
# return 5*(f-32)/9
# f = int(input("enter the measurment of far : "))
# c = (cel(f))
# print(f" to convert {round(c,2)} :")
# cel(f)
# solve the first n natural no.
# def sum(n):
# if(n==1):
# return 1
# return sum(n-1) + n
# n = int(input("enter the no. : "))
# print(sum(n))
# solve the problem:
'''
***
**
*
'''
# def fun(n):
# if(n==0):
# return
# print("*"*(n))
# fun(n-1)
# n = int(input("enter the no. : "))
# fun(n)
# def inch_to_cm(inch):
# return inch * 2.54
# n = int(input("enter the no."))
# print(f"the value of inch in cm is {inch_to_cm(n)}cm")
# def rem(l,word):
# n = []
# for item in l:
# if not(item == word):
# n.append(item.strip(word))
# return n
# l = ["lamaam","adam","aam","am","adithyan","amit"]
# print(rem(l,"am"))
# def multi(n):
# for i in range(1,11):
# print(f"the multiplication of {n} x {i} = {n*i}")
# n = int(input("enter the no. : "))
# multi(n)