Movatterモバイル変換


[0]ホーム

URL:


PDF, PPTX1,396 views

Python programming : Exceptions

The document discusses different types of errors in programming:1. Compile-time errors occur due to syntax errors in the code and prevent the program from compiling. Examples include missing colons or incorrect indentation. 2. Runtime errors occur when the Python virtual machine (PVM) cannot execute the bytecode. Examples include type errors during operations or accessing elements beyond the bounds of a list.3. Logical errors stem from flaws in the program's logic, like using an incorrect formula. Exception handling allows programmers to anticipate and handle errors gracefully. The try/except blocks allow specific code to handle exceptions of a given type. Finally blocks ensure code is executed after the try/except blocks complete.

Embed presentation

Download as PDF, PPTX
ExceptionsTeam Emertxe
Introduction
ErrorsCategories of ErrorsCompile-timeRuntimeLogical
ErrorsCompile-TimeWhat? These are syntactical errors found in the code, due to which programfails to compileExample Missing a colon in the statements llike if, while, for, def etcProgram Outputx = 1if x == 1print("Colon missing")py 1.0_compile_time_error.pyFile "1.0_compile_time_error.py", line 5if x == 1^SyntaxError: invalid syntaxx = 1#Indentation Errorif x == 1:print("Hai")print("Hello")py 1.1_compile_time_error.pyFile "1.1_compile_time_error.py", line 8print("Hello")^IndentationError: unexpected indent
ErrorsRuntime - 1What? When PVM cannot execute the byte code, it flags runtime errorExample Insufficient memory to store something or inability of the PVM toexecute some statement come under runtime errorsProgram Outputdef combine(a, b):print(a + b)#Call the combine functioncombine("Hai", 25)py 2.0_runtime_errors.pyTraceback (most recent call last):File "2.0_runtime_errors.py", line 7, in <module>combine("Hai", 25)File "2.0_runtime_errors.py", line 4, in combineprint(a + b)TypeError: can only concatenate str (not "int") to str"""Conclusion:1. Compiler will not check the datatypes.2.Type checking is done by PVM during run-time."""
ErrorsRuntime - 2What? When PVM cannot execute the byte code, it flags runtime errorExample Insufficient memory to store something or inability of the PVM toexecute some statement come under runtime errorsProgram Output#Accessing the item beyond the arrayboundslst = ["A", "B", "C"]print(lst[3])py 2.1_runtime_errors.pyTraceback (most recent call last):File "2.1_runtime_errors.py", line 5, in <module>print(lst[3])IndexError: list index out of range
ErrorsLogical-1What? These errors depicts flaws in the logic of the programExample Usage of wrong formulasProgram Outputdef increment(sal):sal = sal * 15 / 100return sal#Call the increment()sal = increment(5000.00)print("New Salary: %.2f" % sal)py 3.0_logical_errors.pyNew Salary: 750.00
ErrorsLogical-2What? These errors depicts flaws in the logic of the programExample Usage of wrong formulasProgram Output#1. Open the filef = open("myfile", "w")#Accept a, b, store the result of a/b into the filea, b = [int(x) for x in input("Enter two number: ").split()]c = a / b#Write the result into the filef.write("Writing %d into myfile" % c)#Close the filef.close()print("File closed")py 4_effect_of_exception.pyEnter two number: 10 0Traceback (most recent call last):File "4_effect_of_exception.py", line 8, in<module>c = a / bZeroDivisionError: division by zero
ErrorsCommonWhen there is an error in a program, due to its sudden termination, the following thingscan be suspectedThe important data in the files or databases used in the program may be lostThe software may be corruptedThe program abruptly terminates giving error message to the user making the userlosing trust in the software
ExceptionsIntroductionAn exception is a runtime error which can be handled by the programmerThe programmer can guess an error and he can do something to eliminate the harm caused bythat error called an ‘Exception’BaseExceptionExceptionStandardError WarningArthmeticErrorAssertionErrorSyntaxErrorTypeErrorEOFErrorRuntimeErrorImportErrorNameErrorDeprecationWarningRuntimeWarningImportantWarning
ExceptionsException HandlingThe purpose of handling errors is to make program robustStep-1 try:statements#To handle the ZeroDivisionError Exceptiontry:f = open("myfile", "w")a, b = [int(x) for x in input("Enter two numbers: ").split()]c = a / bf.write("Writing %d into myfile" % c)Step-2 except exeptionname:statementsexcept ZeroDivisionError:print("Divide by Zero Error")print("Don't enter zero as input")Step-3 finally:statementsfinally:f.close()print("Myfile closed")
ExceptionsProgram#To handle the ZeroDivisionError Exception#An Exception handling Exampletry:f = open("myfile", "w")a, b = [int(x) for x in input("Enter two numbers: ").split()]c = a / bf.write("Writing %d into myfile" % c)except ZeroDivisionError:print("Divide by Zero Error")print("Don't enter zero as input")finally:f.close()print("Myfile closed")Output:py 5_exception_handling.pyEnter two numbers: 10 0Divide by Zero ErrorDon't enter zero as inputMyfile closed
ExceptionsException Handling Syntaxtry:statementsexcept Exception1:handler1except Exception2:handler2else:statementsfinally:statements
ExceptionsException Handling: Noteworthy- A single try block can contain several except blocks.- Multiple except blocks can be used to handle multiple exceptions.- We cannot have except block without the try block.- We can write try block without any except block.- Else and finally are not compulsory.- When there is no exception, else block is executed after the try block.- Finally block is always executed.
ExceptionsTypes: Program-1#To handle the syntax error given by eval() function#Example for Synatx errortry:date = eval(input("Enter the date: "))except SyntaxError:print("Invalid Date")else:print("You entered: ", date)Output:Run-1:Enter the date: 5, 12, 2018You entered: (5, 12, 2018)Run-2:Enter the date: 5d, 12m, 2018yInvalid Date
ExceptionsTypes: Program-2#To handle the IOError by open() function#Example for IOErrortry:name = input("Enter the filename: ")f = open(name, "r")except IOError:print("File not found: ", name)else:n = len(f.readlines())print(name, "has", n, "Lines")f.close()If the entered file is not exists, it will raise an IOError
ExceptionsTypes: Program-3#Example for two exceptions#A function to find the total and average of list elementsdef avg(list):tot = 0for x in list:tot += xavg = tot / len(list)return tot.avg#Call avg() and pass the listtry:t, a = avg([1, 2, 3, 4, 5, 'a'])#t, a = avg([]) #Will give ZeroDivisionErrorprint("Total = {}, Average = {}". format(t, a))except TypeError:print("Type Error: Pls provide the numbers")except ZeroDivisionError:print("ZeroDivisionError, Pls do not give empty list")Output:Run-1:Type Error: Pls provide the numbersRun-2:ZeroDivisionError, Pls do not give empty list
ExceptionsExcept Block: Various formatsFormat-1 except Exceptionclass:Format-2 except Exceptionclass as obj:Format-3 except (Exceptionclass1, Exceptionclass2, ...):Format-4 except:
ExceptionsTypes: Program-3A#Example for two exceptions#A function to find the total and average of list elementsdef avg(list):tot = 0for x in list:tot += xavg = tot / len(list)return tot.avg#Call avg() and pass the listtry:t, a = avg([1, 2, 3, 4, 5, 'a'])#t, a = avg([]) #Will give ZeroDivisionErrorprint("Total = {}, Average = {}". format(t, a))except (TypeError, ZeroDivisionError):print("Type Error / ZeroDivisionError”)Output:Run-1:Type Error / ZeroDivisionErrorRun-2:Type Error / ZeroDivisionError
ExceptionsThe assert StatementIt is useful to ensure that a given condition is True, It is not True, it raisesAssertionError.Syntax:assert condition, message
ExceptionsThe assert Statement: ProgramsProgram - 1 Program - 2#Handling AssertionErrortry:x = int(input("Enter the number between 5 and 10: "))assert x >= 5 and x <= 10print("The number entered: ", x)except AssertionError:print("The condition is not fulfilled")#Handling AssertionErrortry:x = int(input("Enter the number between 5 and 10: "))assert x >= 5 and x <= 10, "Your input is INVALID"print("The number entered: ", x)except AssertionError as Obj:print(Obj)
ExceptionsUser-Defined ExceptionsStep-1 class MyException(Exception):def __init__(self, arg):self.msg = argStep-2 raise MyException("Message")Step-3 try:#codeexcept MyException as me:print(me)
ExceptionsUser-Defined Exceptions: Program#To create our own exceptions and raise it when neededclass MyException(Exception):def __init__(self, arg):self.msg = argdef check(dict):for k, v in dict.items():print("Name = {:15s} Balance = {:10.2f}" . format(k, v)) if (v < 2000.00):raise MyException("Less Bal Amount" + k)bank = {"Raj": 5000.00, "Vani": 8900.50, "Ajay": 1990.00}try:check(bank)except MyException as me:print(me)
THANK YOU

Recommended

PPTX
Python basics
PPTX
Python ppt
PPTX
Python-FileHandling.pptx
PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
PPTX
Python Functions
PDF
Python programming : Strings
PDF
Introduction to python programming
PPTX
Python Exception Handling
PPTX
Types of methods in python
PDF
Python Basics
PDF
Python functions
PPTX
Static Data Members and Member Functions
PDF
What is Python Lambda Function? Python Tutorial | Edureka
PDF
Object oriented programming c++
PDF
Python Basics | Python Tutorial | Edureka
PDF
Python libraries
PPTX
Python
PDF
Python Flow Control
PPTX
Python-Functions.pptx
PPT
Python List.ppt
PPTX
STRINGS IN PYTHON
PDF
Python decision making
PDF
Strings in Python
PPT
Introduction to PHP
PDF
Python exception handling
PPTX
File handling in Python
PPT
Introduction to Python
PPTX
EXCEPTION HANDLING class 12th computer science.pptx
PDF
EXCEPTION HANDLING - PYTHON COMPUTER SCIENCE

More Related Content

PPTX
Python basics
PPTX
Python ppt
PPTX
Python-FileHandling.pptx
PDF
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
PPTX
Python Functions
PDF
Python programming : Strings
PDF
Introduction to python programming
PPTX
Python Exception Handling
Python basics
Python ppt
Python-FileHandling.pptx
Exception Handling In Python | Exceptions In Python | Python Programming Tuto...
Python Functions
Python programming : Strings
Introduction to python programming
Python Exception Handling

What's hot

PPTX
Types of methods in python
PDF
Python Basics
PDF
Python functions
PPTX
Static Data Members and Member Functions
PDF
What is Python Lambda Function? Python Tutorial | Edureka
PDF
Object oriented programming c++
PDF
Python Basics | Python Tutorial | Edureka
PDF
Python libraries
PPTX
Python
PDF
Python Flow Control
PPTX
Python-Functions.pptx
PPT
Python List.ppt
PPTX
STRINGS IN PYTHON
PDF
Python decision making
PDF
Strings in Python
PPT
Introduction to PHP
PDF
Python exception handling
PPTX
File handling in Python
PPT
Introduction to Python
Types of methods in python
Python Basics
Python functions
Static Data Members and Member Functions
What is Python Lambda Function? Python Tutorial | Edureka
Object oriented programming c++
Python Basics | Python Tutorial | Edureka
Python libraries
Python
Python Flow Control
Python-Functions.pptx
Python List.ppt
STRINGS IN PYTHON
Python decision making
Strings in Python
Introduction to PHP
Python exception handling
File handling in Python
Introduction to Python

Similar to Python programming : Exceptions

PPTX
EXCEPTION HANDLING class 12th computer science.pptx
PDF
EXCEPTION HANDLING - PYTHON COMPUTER SCIENCE
PPTX
Exception Handling in python programming.pptx
PPTX
Error and exception in python
PDF
lecs101.pdfgggggggggggggggggggddddddddddddb
PPTX
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
PPTX
Download Wondershare Filmora Crack Latest 2025
PPTX
Adobe Photoshop 2025 Cracked Latest Version
PPTX
FL Studio Producer Edition Crack 24 + Latest Version [2025]
PPTX
Exception Handling in Python Programming.pptx
PPTX
Exception Handling in Python programming.pptx
PPTX
Exception Handling and Modules in Python.pptx
PPTX
Exception handling with python class 12.pptx
PPTX
Python Lecture 7
PDF
Unit 4-Exception Handling in Python.pdf
PPTX
Exception Handling.pptx
PPTX
Chapter-12 Error and exception handling.pptx
PDF
Exception handling in python
PPTX
Exception handling.pptx
EXCEPTION HANDLING class 12th computer science.pptx
EXCEPTION HANDLING - PYTHON COMPUTER SCIENCE
Exception Handling in python programming.pptx
Error and exception in python
lecs101.pdfgggggggggggggggggggddddddddddddb
EXCEPTIONS-PYTHON.pptx RUNTIME ERRORS HANDLING
Download Wondershare Filmora Crack Latest 2025
Adobe Photoshop 2025 Cracked Latest Version
FL Studio Producer Edition Crack 24 + Latest Version [2025]
Exception Handling in Python Programming.pptx
Exception Handling in Python programming.pptx
Exception Handling and Modules in Python.pptx
Exception handling with python class 12.pptx
Python Lecture 7
Unit 4-Exception Handling in Python.pdf
Exception Handling.pptx
Chapter-12 Error and exception handling.pptx
Exception handling in python
Exception handling.pptx

More from Emertxe Information Technologies Pvt Ltd

PDF
PDF
Career Transition (1).pdf
PDF
PDF
PDF
Career Transition (1).pdf

Recently uploaded

PDF
[BDD 2025 - Full-Stack Development] The Modern Stack: Building Web & AI Appli...
PDF
Accessibility & Inclusion: What Comes Next. Presentation of the Digital Acces...
PDF
[BDD 2025 - Artificial Intelligence] AI for the Underdogs: Innovation for Sma...
PDF
10 Best Automation QA Testing Software Tools in 2025.pdf
PPTX
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
PDF
Cybersecurity Prevention and Detection: Unit 2
PPTX
Connecting the unconnectable: Exploring LoRaWAN for IoT
PDF
5 Common Supply Chain Attacks and How They Work | CyberPro Magazine
PPTX
Support, Monitoring, Continuous Improvement & Scaling Agentic Automation [3/3]
PDF
Integrating AI with Meaningful Human Collaboration
PDF
[DevFest Strasbourg 2025] - NodeJs Can do that !!
PPTX
"Feelings versus facts: why metrics are more important than intuition", Igor ...
 
PDF
KMWorld - KM & AI Bring Collectivity, Nostalgia, & Selectivity
PDF
Mastering UiPath Maestro – Session 2 – Building a Live Use Case - Session 2
PDF
"DISC as GPS for team leaders: how to lead a team from storming to performing...
 
PDF
So You Want to Work at Google | DevFest Seattle 2025
PDF
Agentic Intro and Hands-on: Build your first Coded Agent
PPTX
MuleSoft AI Series : Introduction to MCP
PDF
Transforming Supply Chains with Amazon Bedrock AgentCore (AWS Swiss User Grou...
PDF
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf
[BDD 2025 - Full-Stack Development] The Modern Stack: Building Web & AI Appli...
Accessibility & Inclusion: What Comes Next. Presentation of the Digital Acces...
[BDD 2025 - Artificial Intelligence] AI for the Underdogs: Innovation for Sma...
10 Best Automation QA Testing Software Tools in 2025.pdf
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
Cybersecurity Prevention and Detection: Unit 2
Connecting the unconnectable: Exploring LoRaWAN for IoT
5 Common Supply Chain Attacks and How They Work | CyberPro Magazine
Support, Monitoring, Continuous Improvement & Scaling Agentic Automation [3/3]
Integrating AI with Meaningful Human Collaboration
[DevFest Strasbourg 2025] - NodeJs Can do that !!
"Feelings versus facts: why metrics are more important than intuition", Igor ...
 
KMWorld - KM & AI Bring Collectivity, Nostalgia, & Selectivity
Mastering UiPath Maestro – Session 2 – Building a Live Use Case - Session 2
"DISC as GPS for team leaders: how to lead a team from storming to performing...
 
So You Want to Work at Google | DevFest Seattle 2025
Agentic Intro and Hands-on: Build your first Coded Agent
MuleSoft AI Series : Introduction to MCP
Transforming Supply Chains with Amazon Bedrock AgentCore (AWS Swiss User Grou...
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf

Python programming : Exceptions

  • 1.
  • 2.
  • 3.
  • 4.
    ErrorsCompile-TimeWhat? These aresyntactical errors found in the code, due to which programfails to compileExample Missing a colon in the statements llike if, while, for, def etcProgram Outputx = 1if x == 1print("Colon missing")py 1.0_compile_time_error.pyFile "1.0_compile_time_error.py", line 5if x == 1^SyntaxError: invalid syntaxx = 1#Indentation Errorif x == 1:print("Hai")print("Hello")py 1.1_compile_time_error.pyFile "1.1_compile_time_error.py", line 8print("Hello")^IndentationError: unexpected indent
  • 5.
    ErrorsRuntime - 1What?When PVM cannot execute the byte code, it flags runtime errorExample Insufficient memory to store something or inability of the PVM toexecute some statement come under runtime errorsProgram Outputdef combine(a, b):print(a + b)#Call the combine functioncombine("Hai", 25)py 2.0_runtime_errors.pyTraceback (most recent call last):File "2.0_runtime_errors.py", line 7, in <module>combine("Hai", 25)File "2.0_runtime_errors.py", line 4, in combineprint(a + b)TypeError: can only concatenate str (not "int") to str"""Conclusion:1. Compiler will not check the datatypes.2.Type checking is done by PVM during run-time."""
  • 6.
    ErrorsRuntime - 2What?When PVM cannot execute the byte code, it flags runtime errorExample Insufficient memory to store something or inability of the PVM toexecute some statement come under runtime errorsProgram Output#Accessing the item beyond the arrayboundslst = ["A", "B", "C"]print(lst[3])py 2.1_runtime_errors.pyTraceback (most recent call last):File "2.1_runtime_errors.py", line 5, in <module>print(lst[3])IndexError: list index out of range
  • 7.
    ErrorsLogical-1What? These errorsdepicts flaws in the logic of the programExample Usage of wrong formulasProgram Outputdef increment(sal):sal = sal * 15 / 100return sal#Call the increment()sal = increment(5000.00)print("New Salary: %.2f" % sal)py 3.0_logical_errors.pyNew Salary: 750.00
  • 8.
    ErrorsLogical-2What? These errorsdepicts flaws in the logic of the programExample Usage of wrong formulasProgram Output#1. Open the filef = open("myfile", "w")#Accept a, b, store the result of a/b into the filea, b = [int(x) for x in input("Enter two number: ").split()]c = a / b#Write the result into the filef.write("Writing %d into myfile" % c)#Close the filef.close()print("File closed")py 4_effect_of_exception.pyEnter two number: 10 0Traceback (most recent call last):File "4_effect_of_exception.py", line 8, in<module>c = a / bZeroDivisionError: division by zero
  • 9.
    ErrorsCommonWhen there isan error in a program, due to its sudden termination, the following thingscan be suspectedThe important data in the files or databases used in the program may be lostThe software may be corruptedThe program abruptly terminates giving error message to the user making the userlosing trust in the software
  • 10.
    ExceptionsIntroductionAn exception isa runtime error which can be handled by the programmerThe programmer can guess an error and he can do something to eliminate the harm caused bythat error called an ‘Exception’BaseExceptionExceptionStandardError WarningArthmeticErrorAssertionErrorSyntaxErrorTypeErrorEOFErrorRuntimeErrorImportErrorNameErrorDeprecationWarningRuntimeWarningImportantWarning
  • 11.
    ExceptionsException HandlingThe purposeof handling errors is to make program robustStep-1 try:statements#To handle the ZeroDivisionError Exceptiontry:f = open("myfile", "w")a, b = [int(x) for x in input("Enter two numbers: ").split()]c = a / bf.write("Writing %d into myfile" % c)Step-2 except exeptionname:statementsexcept ZeroDivisionError:print("Divide by Zero Error")print("Don't enter zero as input")Step-3 finally:statementsfinally:f.close()print("Myfile closed")
  • 12.
    ExceptionsProgram#To handle theZeroDivisionError Exception#An Exception handling Exampletry:f = open("myfile", "w")a, b = [int(x) for x in input("Enter two numbers: ").split()]c = a / bf.write("Writing %d into myfile" % c)except ZeroDivisionError:print("Divide by Zero Error")print("Don't enter zero as input")finally:f.close()print("Myfile closed")Output:py 5_exception_handling.pyEnter two numbers: 10 0Divide by Zero ErrorDon't enter zero as inputMyfile closed
  • 13.
    ExceptionsException Handling Syntaxtry:statementsexceptException1:handler1except Exception2:handler2else:statementsfinally:statements
  • 14.
    ExceptionsException Handling: Noteworthy-A single try block can contain several except blocks.- Multiple except blocks can be used to handle multiple exceptions.- We cannot have except block without the try block.- We can write try block without any except block.- Else and finally are not compulsory.- When there is no exception, else block is executed after the try block.- Finally block is always executed.
  • 15.
    ExceptionsTypes: Program-1#To handlethe syntax error given by eval() function#Example for Synatx errortry:date = eval(input("Enter the date: "))except SyntaxError:print("Invalid Date")else:print("You entered: ", date)Output:Run-1:Enter the date: 5, 12, 2018You entered: (5, 12, 2018)Run-2:Enter the date: 5d, 12m, 2018yInvalid Date
  • 16.
    ExceptionsTypes: Program-2#To handlethe IOError by open() function#Example for IOErrortry:name = input("Enter the filename: ")f = open(name, "r")except IOError:print("File not found: ", name)else:n = len(f.readlines())print(name, "has", n, "Lines")f.close()If the entered file is not exists, it will raise an IOError
  • 17.
    ExceptionsTypes: Program-3#Example fortwo exceptions#A function to find the total and average of list elementsdef avg(list):tot = 0for x in list:tot += xavg = tot / len(list)return tot.avg#Call avg() and pass the listtry:t, a = avg([1, 2, 3, 4, 5, 'a'])#t, a = avg([]) #Will give ZeroDivisionErrorprint("Total = {}, Average = {}". format(t, a))except TypeError:print("Type Error: Pls provide the numbers")except ZeroDivisionError:print("ZeroDivisionError, Pls do not give empty list")Output:Run-1:Type Error: Pls provide the numbersRun-2:ZeroDivisionError, Pls do not give empty list
  • 18.
    ExceptionsExcept Block: VariousformatsFormat-1 except Exceptionclass:Format-2 except Exceptionclass as obj:Format-3 except (Exceptionclass1, Exceptionclass2, ...):Format-4 except:
  • 19.
    ExceptionsTypes: Program-3A#Example fortwo exceptions#A function to find the total and average of list elementsdef avg(list):tot = 0for x in list:tot += xavg = tot / len(list)return tot.avg#Call avg() and pass the listtry:t, a = avg([1, 2, 3, 4, 5, 'a'])#t, a = avg([]) #Will give ZeroDivisionErrorprint("Total = {}, Average = {}". format(t, a))except (TypeError, ZeroDivisionError):print("Type Error / ZeroDivisionError”)Output:Run-1:Type Error / ZeroDivisionErrorRun-2:Type Error / ZeroDivisionError
  • 20.
    ExceptionsThe assert StatementItis useful to ensure that a given condition is True, It is not True, it raisesAssertionError.Syntax:assert condition, message
  • 21.
    ExceptionsThe assert Statement:ProgramsProgram - 1 Program - 2#Handling AssertionErrortry:x = int(input("Enter the number between 5 and 10: "))assert x >= 5 and x <= 10print("The number entered: ", x)except AssertionError:print("The condition is not fulfilled")#Handling AssertionErrortry:x = int(input("Enter the number between 5 and 10: "))assert x >= 5 and x <= 10, "Your input is INVALID"print("The number entered: ", x)except AssertionError as Obj:print(Obj)
  • 22.
    ExceptionsUser-Defined ExceptionsStep-1 classMyException(Exception):def __init__(self, arg):self.msg = argStep-2 raise MyException("Message")Step-3 try:#codeexcept MyException as me:print(me)
  • 23.
    ExceptionsUser-Defined Exceptions: Program#Tocreate our own exceptions and raise it when neededclass MyException(Exception):def __init__(self, arg):self.msg = argdef check(dict):for k, v in dict.items():print("Name = {:15s} Balance = {:10.2f}" . format(k, v)) if (v < 2000.00):raise MyException("Less Bal Amount" + k)bank = {"Raj": 5000.00, "Vani": 8900.50, "Ajay": 1990.00}try:check(bank)except MyException as me:print(me)
  • 24.

[8]ページ先頭

©2009-2025 Movatter.jp