Discuss / Python / day3 打卡

day3 打卡

Topic source

# -*- coding: utf-8 -*-

name=input('学生姓名:')

s1=int(input('去年的成绩:'))

s2=int(input('今年的成绩:'))

r = (s2-s1)/s1*100

print('%s的成绩从去年的%d提升到了今年的%d,提升了%.1f%%' % (name,s1,s2,r))

重复簇

#2 Created at ... [Delete] [Delete and Lock User]

print('你的这种写法我喜欢')

浪子神丁

#3 Created at ... [Delete] [Delete and Lock User]
#! /usr/bin/env python# -*- coding: utf-8 -*-for y in range(30, -30, -1):    value = []    for x in range(-30, 30):        if ((x * 0.05) ** 2 + (y * 0.1) ** 2 - 1) ** 3 - (x * 0.05) ** 2 * (y * 0.1) ** 3 <= 0:            value.append("*")        else:            value.append("")        s = "".join(value)    print(s)

Purfectionist

#4 Created at ... [Delete] [Delete and Lock User]

牛逼牛逼

为什么 r = (s2-s1)/s1*100这里后面一定要 /s1*100的呢?


  • 1

Reply