Hello to everyone. I have a problem in python3 .Need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hello to everyone. I have a problem in python3 .Need help

The problem is as follows. My tester says that the Value is written to the attribute of the object, but should be in the attribute of the class. Description in code. https://code.sololearn.com/c1nIX9A349YF/?ref=app

21st Jul 2020, 7:09 AM
Михаил
7 Answers
+ 4
As already said, i suppose an issue in the tester. Can you put it also in your file in playground, that you already posted?
21st Jul 2020, 9:52 AM
Lothar
Lothar - avatar
+ 3
I did some tests with the class and its methods, this seems to work as expected. May be you check your tester orvpots it here? Thanks!
21st Jul 2020, 9:03 AM
Lothar
Lothar - avatar
+ 2
I think it's about the history_array, it should be declared outside of methods to be in class level ( static variable in other languages.) so that the array can be accessed with the class name.
21st Jul 2020, 7:41 AM
Bahhaⵣ
Bahhaⵣ - avatar
+ 2
Samsil Arefeen fixed. Thanks.
21st Jul 2020, 11:15 AM
Михаил
0
Samsil Arefeen I tried, but the question was too long and I didn't post it. So I wrote in another section.
21st Jul 2020, 8:59 AM
Михаил
0
Lothar what does orvpots mean?
21st Jul 2020, 9:11 AM
Михаил
0
Lothar It works until you insert the last two lines to check the test program.
21st Jul 2020, 9:13 AM
Михаил