菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
476
0

实验2

原创
05/13 14:22
阅读数 71599
x1 , y1 = 1.2 , 3.57
x2 , y2 = 2.26 , 8.7
print('{:-^40}'.format('输出1'))
print('x1 = {},y1 = {}'.format(x1,y1))
print('x2 = {},y2 = {}'.format(x2,y2))
print('{:-^40}'.format('输出2'))
print('x1 = {:.1f},y1 = {:.1f}'.format(x1,y1))
print('x2 = {:.1f},y2 = {:.1f}'.format(x2,y2))
print('{:-^40}'.format('输出3'))
print('x1 = {:<15},y1 = {:<15}'.format(x1,y1))
print('x2 = {:<15},y2 = {:<15}'.format(x2,y2))

  

x = input('请输入一串英文')
x = x.upper()
newx = x.replace('A','')
print(newx)

  

name_list = ['david bowie','louis armstrong','lenard cohen','bob dylan','cocteau twins']
n = 1
for name in name_list:
    print(f'{n}:{name.title()}')
    n += 1

  

name_list = ['david bowie','louis armstrong','lenard cohen','bob dylan','cocteau twins']
n = 1
name_list.sort()
for name in name_list:
    print(f'{n}:{name.title()}')
    n += 1

  

x = input('enter a ssentence')
print(len(x.splitlines()))
print(len(x.split()))
print(len(x))
print(x.count(' '))

  

x = list()
i = 0
while i<3:
    x.append(input('输入想要加入愿望清单的事情:'))
    i += 1
print('{:-^40}'.format('我的愿望清单'))
n = 1
for newx in x:
    print(f'{n}.{newx}')

  

发表评论

0/200
476 点赞
0 评论
收藏
为你推荐 换一批