Python RAISE?? #python #programming #coding

preview_player
Показать описание
This video shows you how to use Python's raise keyword.

Background Music:
Creative Commons / Attribution 4.0 International (CC BY 4.0)
Рекомендации по теме
Комментарии
Автор

You can also make new error codes with classes!

theminecommander
Автор

You should not use bare Exception for errors. User ValueError or something

_Elvyra._
Автор

Raise StopIteration is common when you're creating a generator. Worth doing a short about if you haven't already.

junglerat
Автор

you are one of my favorite coding youtubers

itsatticuss
Автор

Technically it can just be
if user_input % 2:
...

Since the result will only be 0 or 1.
Might also be better to use ValueError or something similar than just Exception

abdullatif
Автор

What's the name of song? I want a 1hour video of that 😊

Josue_Estrada
Автор

just use integer division, teams would be kinda uneven but better to just give it up completely

PlasmaUI
Автор

also you could do "assert(user_input % 2 == 0)" to raise an AssertionError

johnsarofeen
Автор

So "raise" in python is just "throw " or "throws" in java? Neat.

Alexandrite-qlkq
Автор

But better to detect and message user in game environment rather than command line

JJ-frki
Автор

hey, what does f do in python? I'm new to python

chris_beingstupid
Автор

I'm new to Python, can someone explain to me that why code is not throwing error when he is dividing a string cause input return values in string right?

ammarkhulood
Автор

I’m really new at Python, can someone tell me more about the modulus bit? Namaste

MostlyReading
Автор

Question what does the "f" do?

fevad
Автор

I am new to python, but would It work just converting it to integer?

shrimp
Автор

You can just do

user_input = 11
team_a = user_input // 2
team_b = user_input - team_a

This will make it 6 players in one team and 5 in the other

ktz
Автор

correct me if I'm wrong, but's like throw keyword in Dart

tutonjason
Автор

whats ur theme that u use in visual studio code?

TrueMayo
Автор

Thank you but Background music is annoying

zakariazain
Автор

When you "Intentionally" wants your code to throw an error lol

ItsPungpond