-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc1.py
More file actions
47 lines (35 loc) · 1 KB
/
Copy pathfunc1.py
File metadata and controls
47 lines (35 loc) · 1 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
def greatest(a, b):
if(a>b):
return a
else:
return b
def toFar(c):
return float((c*9/5)+32)
def summation(n):
if(n==1):
return 1
else:
return n+summation(n-1)
def pattern(n):
for i in range(1, n+1):
j= 1
while(j<=i):
print("*", end="")
j+=1
print()
def multiply(n):
for i in range(1, 11):
print(f"{n}x{i}={n*i}")
x = int(input("Enter first number : "))
y = int(input("Enter second number : "))
z = int(input("Enter third number : "))
m = greatest(greatest(x, y), z)
print(f"The greates of all three numbers is :{m}")
c=int(input("Enter temperature in degree celcius "))
print(f"The temperature in fahrenheit is {toFar(c)}")
n=int(input("Enter a number upto which sum need to be calculated :"))
print(f"Sum is {summation(n)}")
n = int(input("Enter number of lines for which pattern to be printed : "))
pattern(n)
n = int(input("Enter number whose table need to be printed : "))
multiply(n)