what is the difference between raise and print? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

what is the difference between raise and print?

23rd Jun 2016, 4:35 AM
임정섭
임정섭 - avatar
2 Antworten
+ 1
Raising an error halts the entire program at that point (unless the exception is caught), whereas printing the message just writes something to stdout -- the output might be piped to another tool, or someone might not be running your application from the command line, and the print output may never be seen.
23rd Jun 2016, 7:11 AM
Neelapu Harsha Vardhan Reddy
Neelapu Harsha Vardhan Reddy - avatar
+ 1
raise is used for raising exceptions. And print is used to for output
27th Jun 2016, 5:21 PM
Narendra Ram