yeqing2333
yeqing2333
全部文章
分类
归档
标签
去牛客网
登录
/
注册
yeqing2333的博客
全部文章
(共10篇)
题解 | #重载运算#
class Coordinate(object): def __init__(self,x,y): self.x=x self.y=y  ...
Python3
2022-08-08
1
238
题解 | #菜品的价格#
s=input() d={'pizza':10,'rice':2,'yogurt':5} if s in list(d.keys()): print(d[s]) else: print(8)
Python3
2022-08-07
0
286
题解 | #牛牛的逻辑运算#
x,y=[int(i) for i in input().split()] print(x and y) print(x or y) print(not x) print(not y)
Python3
2022-08-07
3
295
题解 | #谁的数字大#
#原本的代码,写的太复杂了 x,y=input().split() x=int(x) y=int(y) if x>y: print('True') elif x<=y: print('False') if x<y: &...
Python3
2022-08-07
5
374
题解 | #朋友的年龄是否相等#
x,y=input().split() x=int(x) y=int(y) if x!=y: print('False') else: print('True')
Python3
2022-08-07
0
272
题解 | #除法与取模运算#
x=int(input()) y=int(input()) print(x//y,x%y) print('%.2f'%(x/y))
Python3
2022-08-07
9
879
题解 | #用列表实现栈#
n=int(input()) stack=[1,2,3,4,5] stack.pop() print(stack) stack.pop() print(stack) stack.append(n) print(stack)
字符串
Python3
2022-08-07
0
202
题解 | #密码游戏#
n=int(input()) sn=list(str(n)) isn=[(int(i)+3)%9 for i in sn] isn[0],isn[2]=isn[2],isn[0] isn[1],isn[3]=isn[3],isn[1] s='' sisn=[str(i) for i in is...
字符串
Python3
2022-08-07
0
185
题解 | #有序的列表#
my_list=['P','y','t','h','o','n'] print(sorted(my_list)) print(my_list) my_list.sort(reverse=True) print(my_list)
Python3
2022-08-07
1
288
题解 | #生成列表#
str=input().split() print(str)
字符串
Python3
2022-08-07
9
350