9-11行代码去掉,在第三行写
print(a+b)
print(a-b)
print(a*b)
注意代码缩进
把下面3行print代码放在 solve 里,并且把3个{} 修改为 {a+b} {a-b} {a*b}
def solve(a, b):
print(a + b)
print(a - b)
print(a * b)
a = int(input())
b = int(input())
solve(a, b)
不知道你这个问题是否已经解决, 如果还没有解决的话:def getChatroomFriends(chatrooms, friend_overlap):
#% 处在相同的群
chatroom_friends = {}
clen = len(chatrooms)
for i, c in enumerate(chatrooms):
print('{}/{}'.format(i, clen))
time.sleep(0.5)
specifed_chatroom = itchat.update_chatroom(c['UserName'])
specifed_chatroom_memberList = list(specifed_chatroom['MemberList'])
chatroom_name = specifed_chatroom['NickName']
chatroom_friends[chatroom_name] = {'num':0, 'friends':[], 'total':len(specifed_chatroom_memberList)}
for m in specifed_chatroom_memberList:
if m['UserName'] in friend_overlap.index:
chatroom_friends[chatroom_name]['friends'].append(m['UserName'])
chatroom_friends[chatroom_name]['num'] += 1
return chatroom_friends