• 选择

  • Python123——测验3:Python基本数据类型

     

     Python123——测验3:Python基本数据类型

     

     

  • 程序

  • Python123——测验3:Python基本数据类型

     

     s = input()
    a = s.split('-')
    # print(a)
    print(a[0]+"+"+a[-1])
    # s.split("s中的分割符"),此函数会返回一个列表!

  

Python123——测验3:Python基本数据类型

 

 def cubic_Format():

    n = eval(input())
    if isinstance(n, int):
        print("{:#^20d}".format(n**3))
    elif isinstance(n, float):
        print('{:#^20f}'.format(n**3))


 

 

def cubic_Format_1():
    n = eval(input())
    if isinstance(n, int):
        n = str(pow(n, 3))
        print(n.center(20, '#'))
    elif isinstance(n, float):
        n = str(pow(n, 3))
        print(n.center(20, '#'))
Python123——测验3:Python基本数据类型

def count_characters():
    s = input().split(' ')
    print(s[0].count(s[1]))

Python123——测验3:Python基本数据类型

 

 

def encrypt_Craesar():
    p = input()
    c = ''
    for i in p:
        if 'a' <= i <= 'z':
            c += chr(ord('a') + (ord(i)-ord('a')+3) % 26)
        elif 'A' <= i <= 'Z':
            c += chr(ord('A') + (ord(i)-ord('A')+3) % 26)
    print(c)

 

 



相关文章:

  • 2022-12-23
  • 2021-08-31
  • 2021-11-06
  • 2021-10-11
  • 2022-01-12
猜你喜欢
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-05-12
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案