def function(n): if n==1: return 100 return function(n-1)+20 print(function(5))

def seach_max(list): max=list[1] for x in list[1:]: if x>max: max=x return max
print('[11,56,33,5]最大值',seach_max([11,56,33,5])) def seach_ave(list): sum=0 for
xin list: sum+=x return sum / len(list) print('[11,56,33,5]最大值',seach_ave([11,56
,33,5])

def max(list): if type(list) == dict: max_num = 0 for x in list: if max_num <
list[x]: max_num = list[x] else: max_num = list[0] for x in list: if max_num < x
: max_num = x return max_num param = {'小明':90, '张三': 76, '路飞':30, '小花': 98}
print(max(param))

ef rjust(str1, width, fill_char): le = len(str1) # 处理指定宽度比原字符串宽度小 if width < le
: width = le new_str = fill_char*(width-le) + str1 print(new_str) rjust('abc', 6
, '*')

def capitalize(str): x = str[0] if 'a' <= x <= 'z': x = chr(int(ord(x)-32))
print(f'{x}{str[1:]}') else: print(str) capitalize('abc')

def isdigit(str): for x in str: if not '0'<=x<='9': print(False) return print(
True) isdigit('1b345')

def upper(str): new_str = '' for i in str: if 'a' <= i <= 'z': new_str += chr(
ord(i) - 32) else: new_str += i return new_str print("aAbcD->",upper("aAbcD"))

def replace(str,oldelem,newelem): str_list = str.split(oldelem) return newelem.
join(str_list) print('abclkj替换后-》',replace("abclkj",'clk','opq'))