Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions km72/Podolsky_David/11/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
def inputCheck1():
n = input('Enter positive integer n=')
if not(n.isdigit()) or int(n)==0 or len(n)==0:
print('It has to be a positive integer')
return inputCheck1()
else:
return int(n)

def inputCheck2():
x = input('Enter a float number (except x=1) x=')
if x == 1:
print('x has to be a float number (except x=1)')
return inputCheck2()
try:
float(x)
return float(x)
except ValueError:
print('x has to be a float number (except x=1)')
return inputCheck2()

def equationSum(x, n, sum=0):
if n > 0:
sum=(((x+2)**(n))/(x-1)) + equationSum(x, (n-1))
return sum
else:
return sum

print(equationSum(inputCheck2(), inputCheck1()))
14 changes: 14 additions & 0 deletions km72/Podolsky_David/11/task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def minOfTheList(l, i):
global min
if i < len(l) - 1:
if min > l[i + 1]:
min = l[i+1]
return minOfTheList(l, i+ 1)
else:
return minOfTheList(l, i + 1)
return min

i=int(0)
l=input('Enter the list of numbers ').split()
min=l[i]
print(minOfTheList(l, i))
9 changes: 9 additions & 0 deletions km72/Podolsky_David/11/task3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def reverse(l):
if len(l) < 2:
return l
else:
halfL = len(l) // 2
return reverse(l[halfL:]) + reverse(l[:halfL])

l=[1,'an',345]
print(reverse(l))
Binary file added km72/Podolsky_David/12/html/bc_s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added km72/Podolsky_David/12/html/bdwn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added km72/Podolsky_David/12/html/closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added km72/Podolsky_David/12/html/doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading