זאת השגיאה שיצאה לי:
AssertionError: assert None + where None = <bound method Poll.remove_option
of <test_checks.Poll object at 0x7f01f3171040>>('Yellow')
+ where <bound method Poll.remove_option of <test_checks.
Poll object at 0x7f01f3171040>> = <test_checks.Poll object at 0x7f01f3171040>.remove_option
אשמח להכוונה למה הקוד לא בסדר.
זה מה שרשמתי בתוך המחלקה:
def remove(self, vote):
del self.vote_stats[vote]
print(True)
def remove_option(self, votes):
if type(votes) == str:
self.remove(votes)
elif isinstance(votes, (list, dict, tuple)):
for vote in votes:
self.remove(vote)
else:
print(False)
את מדפיסה True ולא מחזירה (return)
תנסי בלי print לפתור את התרגיל ותראי מה יוצא לך
מצטרף כאן.
אני לא מצליח לפענח מה אני עושה לא נכון לפי הבודק האוטומטי.
AssertionError: assert None + where None = <bound method Poll.add_option of <test_checks.Poll object at 0x7fd87258d6d0>>(‘Yellow’) + where <bound method Poll.add_option of <test_checks.Poll object at 0x7fd87258d6d0>> = <test_checks.Poll object at 0x7fd87258d6d0>.add_option
לא מחזיר את מה שהתבקש בהוראות אני מניחה. שים לב שהן ממשיכות אחרי סעיף 5
עברתי עליהן.
הוספתי רנדום ועוד… אני לא מצליח למצוא איזה תרחיש מוזר הבודק עושה.
הכל כמובן אצלי True
החזרת False כשצריך? כי לפי הבודק אתה מחזיר באיזשהו שלב None וזה תרחיש לא אפשרי לפי ההוראות
וההדפסות?
בוודאי.
ואני לא מבין איפה הנזירה מתחבאת
מוזמן לשלוח לי את add_option בפרטי