The different between raise and assert | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

The different between raise and assert

What's the difference between raise and assert? Aren't they used to raise error?

13th Oct 2020, 4:34 AM
Haposan Delon Benyamin Pasaribu
1 Antwort
0
Assert is used to test a condition,. If false it return an AssertionError. Raise is used to throw exception and you can use it throw an AssertionError
13th Oct 2020, 5:15 AM
Kirabo Ibrahim
Kirabo Ibrahim - avatar