-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter8_ps.py
More file actions
55 lines (44 loc) · 931 Bytes
/
chapter8_ps.py
File metadata and controls
55 lines (44 loc) · 931 Bytes
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
# program1
# def greatest(a,b,c):
# if(a>b and a>c):
# return a
# elif(b>c):
# return b
# else:
# return c
# a=4
# b=6
# c=12
# print(greatest(a,b,c))
# program2 fahrenheit to celsius
# def f_to_c(f):
# return 5*(f-32)/9
# f=int(input("Enter temperature in f:"))
# print(f_to_c(f))
# print(f"{f_to_c(f)} °C")
# print(f"{round(f_to_c(f),2)} °C")
# program3---preventing print() function from new line
# print("a")
# print("b")
# print("c",end="")
# print("d",end="")
# program4--calculate sum of first n natural numbers using recursion
# def sum(n):
# if(n==1):
# return 1
# return sum(n-1)+n
# print(sum(5))
# program5
# def pattern(n):
# if(n==0):
# return
# print("*"*n)
# pattern(n-1)
# pattern(5)
# program
def rem(l,word):
for item in l:
l.remove(word)
return l
l=["siri","sonu","priya","nikita"]
print(rem(l,"sonu"))