Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8a1c72

Browse files
2 parents 6a2d3fc + 1385478 commit d8a1c72

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

‎Day 3/str-rev-recur.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def rev(s):
2+
if s == '':
3+
return ''
4+
return s[-1] + rev(s[:-1])
5+
6+
7+
s = input('Enter a string: ')
8+
print(rev(s))

‎Day 4/Text1.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Day 4/Text2.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Day 4/max-sum.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
a1 = list(map(int, input('Enter the first array').split()))
2+
a2 = list(map(int, input('Enter the first array').split()))
3+
4+
print(max(a1) + max(a2))

‎Day 4/pascal-triangle.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import math
2+
3+
4+
def ncr(n, r):
5+
return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))
6+
7+
8+
n = int(input('Enter the number of lines: '))
9+
10+
for i in range(n):
11+
print(' ' * (n - i - 1), end='')
12+
for j in range(i + 1):
13+
print(ncr(i, j), end=' ')
14+
print()

‎Day 4/pascal-triangle2.py

Whitespace-only changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /