0
11th May 2019, 1:56 PM
Nikhil Tale
Nikhil Tale - avatar
2 ответов
+ 3
hi, creating an instance of inbox requires 2 positional arguments: c = inbox(1,'aaa') use this to run the code
11th May 2019, 2:14 PM
Lothar
Lothar - avatar
+ 1
First, cprint is not a valid keyword maybe you meant print Also, the line users[c.number] = cprint(users[3]) cannot work since when this line is reached the first time users is an empty dict and thus a key error wil be raised You could change users = {} by users = defaultdict(str) (coming from from collections import defaultdict) that will handle the case when the key is associated with no value The following code cannot work c = inbox # c will be the type inbox and not an instance of inbox print(c.number) you can replace it by: c = inbox.messagebox()
11th May 2019, 2:15 PM
Paul