# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

#自己定义一个reverse(s)函数，功能返回字符串s的倒序字符串。
def reverse(s):
    for i in range(1,len(s)):
        print(s[len(s)-i],end='')        
s=input('请输入一个字符串')  
reverse(s)


# +
#写函数，根据给定符号和行数，打印相应直角三角形，等腰三角形及其他形式的三角形
def R_at(s):
    for i in range(1, len(s)*2+1):
        for j in range(1,i):
            print(s[0], end='')
        print()
        
def I_t(s):
    for m in range(1, len(s)*2+1):
        print((len(s)*2-m)*' ' + s[0]*m, end='')
        print()        
s=input('请输入一个字符串')
R_at(s)
I_t(s)


# +
def my_word(a):
    if a.endswith('s')or a.endswith('ch') or a.endswith('sh') or a.endswith('x') or a.endswith('o'):
        print(a,'es',sep='')
    else:
        print(a,'s',sep='')

a=input('请输入一个英文名词（单数形式）')
my_word(a)

StarcoderdataJupyterScriptsDedupFiltered