From 3492ada40504b9f36f76184fcada0a8fadcfd803 Mon Sep 17 00:00:00 2001 From: jarvis-sharma Date: Sat, 3 Oct 2020 11:47:00 +0530 Subject: [PATCH] added few programs that i have solved --- Find angle MBC.py | 7 +++++++ Text wrap.py | 3 +++ map and lambda function.py | 17 +++++++++++++++++ triangle Quest.py | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 Find angle MBC.py create mode 100644 Text wrap.py create mode 100644 map and lambda function.py create mode 100644 triangle Quest.py diff --git a/Find angle MBC.py b/Find angle MBC.py new file mode 100644 index 0000000..dcdea53 --- /dev/null +++ b/Find angle MBC.py @@ -0,0 +1,7 @@ +# Enter your code here. Read input from STDIN. Print output to STDOUT +import math +a=int(input()) +b=int(input()) +c=a/b +d=math.atan(c) +print(str(int(round(math.degrees(d))))+'°') diff --git a/Text wrap.py b/Text wrap.py new file mode 100644 index 0000000..5abc12f --- /dev/null +++ b/Text wrap.py @@ -0,0 +1,3 @@ +def wrap(string, max_width): + return textwrap.fill(string,max_width) + diff --git a/map and lambda function.py b/map and lambda function.py new file mode 100644 index 0000000..11001c5 --- /dev/null +++ b/map and lambda function.py @@ -0,0 +1,17 @@ +cube = lambda x: x*x*x + +def fibonacci(n): + # return a list of fibonacci numbers + li=[] + if n>2: + li.append(0) + li.append(1) + for i in range(n-2): + li.append(li[i]+li[i+1]) + return li + elif n==2: + return [0,1] + elif n==1: + return [0] + else: + return [] diff --git a/triangle Quest.py b/triangle Quest.py new file mode 100644 index 0000000..cc1507a --- /dev/null +++ b/triangle Quest.py @@ -0,0 +1,2 @@ +for i in range(1,int(input())): + print([0,1,22,333,4444,55555,666666,7777777,88888888,999999999][i])