-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17_practice_Functions.py
More file actions
69 lines (48 loc) · 1.35 KB
/
17_practice_Functions.py
File metadata and controls
69 lines (48 loc) · 1.35 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
# Q1. Find greatest of three
# def greatest(a,b,c):
# if(a > b and a > c):
# print("I am the greatest",a)
# elif(b > a and b > c):
# print("I am the greatest",b)
# else:
# print("I am the greatest",c)
# a = int(input("Enter your number: "))
# b = int(input("Enter your number: "))
# c = int(input("Enter your number: "))
# greatest(a,b,c)
# Q2. Convert farenheit into celcius
# def temp(a):
# celsius = (a - 32)/1.8
# print(celsius)
# a = int(input("Enter your temperature: "))
# temp(a)
# Q3. Sum of first n natural numbers using recursion
# def sum(a):
# if(a == 1):
# return 1
# return sum(a - 1) + a
# a = int(input("Enter your number: "))
# z = sum(a)
# print(z)
# Q4. star pattern
# def star(n):
# for i in range(n,0,-1):
# print("*" * i , end="")
# print("\n")
# n = int(input("Enter your number: "))
# star(n)
# Q5. Remove a given word from list
# def remove(a):
# for item in list:
# if(a == item):
# list.remove(a)
# print(list)
# list = ["hello" , "hh" , "9" , 9]
# a = (input("Enter your number: "))
# remove(a)
# Q6. Print table
# def table(a):
# for i in range(1,11,1):
# print(a,"*",i,"=",a*i)
# a = int(input("Enter your number: "))
# table(a)