raise exception 1
This commit is contained in:
parent
eae541298b
commit
348bb4542b
1 changed files with 9 additions and 0 deletions
9
python-temel/raise.exception.py
Normal file
9
python-temel/raise.exception.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
def banner(text):
|
||||
if not isinstance(text, str):
|
||||
raise TypeError
|
||||
print('-' * len(text))
|
||||
print(text)
|
||||
print('-' * len(text))
|
||||
|
||||
banner('ankara')
|
||||
banner(100)
|
Loading…
Reference in a new issue