注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
SQL 30 min: 地里的invoice原题。
Pyhon 45min:新题。原payment table记不清了,但是解法是一样的。
# Sender_id, receipent_id, payment_id
Payment = [
(0,1,1),
(1,2,2),
(3,2,3),
. 1point3acres(4,2,4)
]
#1) find the inviter of the particular customer
#put all the senders in a list first, and then sort that sub-list
def invitor2(Payment, customer_id):
sender_list = []. 1point3acres
res = []
for x,y,z in Payment:
if y == customer_id:. Χ
您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 st) == 0:
return []. Waral dи,
else:. From 1point 3acres bbs
return res
. .и
test = invitor2(Payment, 2)
print(test) |