Appficial
Appficial
  • 298
  • 1 873 006
Python Exceptions - How to Define your own Custom Exception Class - Code Example APPFICIAL
You can define your own custom exception type, by inheriting from a built-in exception class and modifying it as needed
You can raise your custom exception in your program
It is good practice to end the name of the custom exception with “Error”, such as DivideByZeroError
Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
zhlédnutí: 8 826

Video

Python Exceptions - Exception Handling using the Finally Block - Try Except Finally Code Example
zhlédnutí 2,5KPřed 2 lety
After the except blocks, you can have one finally block, which is used to clean-up code actions such as: - Close a connection to a database or file - Printing a message to output The finally clause is always the last code executed in your exception handling code, whether an exception occurred or not Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE...
Python Exceptions - Exception Handling with Functions Code Example - Learn to Code - APPFICIAL
zhlédnutí 3KPřed 2 lety
If an exception happens inside a function, and the function doesn’t handle it, then the function exits and checks if there is exception handling around the function call It is better to handle exceptions around a function call than to handle it inside a function Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped...
Python Exceptions - Raising Exceptions - How to Manually Throw an Exception Code Example - APPFICIAL
zhlédnutí 10KPřed 2 lety
If you have code written that detects an error, execute a raise statement to exit the try block and start executing the except block Example: raise ValueError(’Invalid number’) Creates a new exception of type ValueError The string argument explains the error Use the as keyword to provide an object for your exception Subscribe to Appficial for more programming videos coming soon. Also, don't for...
Python Exceptions - Exception Handling with Multiple Handlers - Multiple Except Blocks Code Example
zhlédnutí 2,1KPřed 2 lety
If more than one type of exception may be raised in a try block, then you can have multiple exception handlers by adding more except blocks of code to handle each one An unhandled exception happens if no exception handler exists Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
Python Exceptions - Exception Handling with Try - Except - Code Example - Learn to Program APPFICIAL
zhlédnutí 666Před 2 lety
An exception is an event that disrupts the normal flow of your Python program. Some examples: KeyError - raised when a key is not found in a dictionary IndexError - raised when you try to access an element outside the range of the list Exception handling is error-checking code in your program that looks for a special circumstance Exception handling is done with try-except blocks of code try - t...
Python Classes - Memory Allocation and Garbage Collection
zhlédnutí 1,1KPřed 2 lety
Memory allocation is the process of granting and allocating memory when an application requests it. The python runtime automatically allocates memory for your objects, such as lists, dictionaries, etc. It does this by requesting memory from your operating system. An application cannot use memory that is not allocated. In some programming languages, like C , the programmer is responsible for mem...
Python Classes - Operator Overloading Methods with Code Example - Learn to Program APPFICIAL
zhlédnutí 908Před 2 lety
Operator Overloading allows you to replace the functionality of numeric operators (such as , -, *, and /) with a method For example, you can write an add (self, other) method to replace the functionality of the ( ) operator Use the built-in isinstance() method to handle different object types for the operation Method / Description add (self, other) / Add ( ) sub (self, other) / Subtract (-) mul...
Python Classes - Class Customization and Rich Comparison Methods with Code Example - APPFICIAL
zhlédnutí 1,7KPřed 2 lety
Class customization allows you to define how a class behaves for specific operations such as printing or accessing attributes Customize classes by creating instances methods using special method names (double underscores) Rich comparison methods overload some common comparison operators. They allow you to overload the logical operators. Rich comparison method / Overloaded operator lt (self, oth...
Python Classes - Class Interface and Abstract Data Type ADT - With Code Examples - Learn to Program
zhlédnutí 4,4KPřed 2 lety
A class interface lists the methods available to create, modify, or access a class instance Some methods may only be used internally by a class, and those methods typically start with an underscore Abstract data type (ADT) - a data type constrained to a class interface Python lacks information hiding capabilities of other programming languages, because you cannot make methods private Subscribe ...
Python Classes - Class Constructors with Code Example using Parameters - Learn To Code - APPFICIAL
zhlédnutí 4,8KPřed 2 lety
A constructor initializes an instance of a class (instance object) using the init() method Add parameters to the constructor to initialize the instance attributes You can also provide default values to the parameters The self parameter saves arguments passed to the constructor as instance attributes Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE...
Python Classes - Class and Instance Object Types and Attributes - Easy Code Examples - APPFICIAL
zhlédnutí 1,6KPřed 2 lety
Programs with user-defined classes can contain 2 types of objects: Class object - used to create instance objects Instance object - an instance of the class object There can also be 2 types of attributes: Class attribute - shared by all instances of the class Instance attribute - unique to each class instance Subscribe to Appficial for more programming videos coming soon. Also, don't forget to ...
Python Classes - Instance Methods vs. Functions - Methods that Belong to an Object - APPFICIAL
zhlédnutí 3,9KPřed 2 lety
Instance method - a function within a class, that only an object of the class can call using dot notation Dot notation (also called the attribute reference operator) - provides access to attributes or methods of an object The init method is a constructor method which sets up the initial state of the new instance The double underscores indicate the method is a special method name, which implemen...
Python Classes - Intro to Classes - How to Create a Class with Example - Learn To Program APPFICIAL
zhlédnutí 1,9KPřed 2 lety
Object-oriented programming (OOP) allows you to model your code after real-world objects. An object has data (attributes) that describe it, and actions (methods) that it can perform. The class keyword defines the related attributes and methods of an object. Calling a class creates an instance (new object) Subscribe to Appficial for more programming videos coming soon. Also, don't forget to clic...
Python - Nested Dictionary Data Structure with Code Example - APPFICIAL
zhlédnutí 2,1KPřed 2 lety
A nested dictionary is when a dictionary contains another dictionary as a value A data structure, such as a nested dictionary, organizes data in a logical and easy to understand fashion Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
Python Dictionary Iteration using a For Loop and View Object Methods - Code Examples by APPFICIAL
zhlédnutí 3,7KPřed 2 lety
Python Dictionary Iteration using a For Loop and View Object Methods - Code Examples by APPFICIAL
Python Dictionary Methods - clear() get() update() and pop() with Code Examples - Learn Programming
zhlédnutí 692Před 2 lety
Python Dictionary Methods - clear() get() update() and pop() with Code Examples - Learn Programming
Python Dictionary - How to create a Dictionary and useful Dict Operations - Code Example APPFICIAL
zhlédnutí 2,5KPřed 2 lety
Python Dictionary - How to create a Dictionary and useful Dict Operations - Code Example APPFICIAL
Python Modifying a List and Conditional List Comprehension with Code Example - APPFICIAL
zhlédnutí 774Před 2 lety
Python Modifying a List and Conditional List Comprehension with Code Example - APPFICIAL
Python List Slicing - Code Example using Slice Notation and Stride - Python Programming Course
zhlédnutí 970Před 2 lety
Python List Slicing - Code Example using Slice Notation and Stride - Python Programming Course
Python Nested Lists - Multi-Dimensional List with Code Example - Learn Python Programming
zhlédnutí 7KPřed 2 lety
Python Nested Lists - Multi-Dimensional List with Code Example - Learn Python Programming
Python - How to Iterate Through a List using for loop and the enumerate() Function - Code Example
zhlédnutí 6KPřed 2 lety
Python - How to Iterate Through a List using for loop and the enumerate() Function - Code Example
Python List Methods - Code Examples to Add Insert Remove Sort and Reverse Lists - APPFICIAL
zhlédnutí 838Před 2 lety
Python List Methods - Code Examples to Add Insert Remove Sort and Reverse Lists - APPFICIAL
Python List - How to Create a List using Brackets or the list() Function - Learn To Program
zhlédnutí 1,3KPřed 2 lety
Python List - How to Create a List using Brackets or the list() Function - Learn To Program
Python - The split() and join() methods - String Tutorial with Example
zhlédnutí 8KPřed 2 lety
Python - The split() and join() methods - String Tutorial with Example
Python String Methods - upper() lower() strip() find() replace() startswith() capitalize() + MORE
zhlédnutí 2,4KPřed 2 lety
Python String Methods - upper() lower() strip() find() replace() startswith() capitalize() MORE
Python - String Formatting using F-String Tutorial with Examples
zhlédnutí 4,6KPřed 2 lety
Python - String Formatting using F-String Tutorial with Examples
Python - String Splicing and Substrings Tutorial with Examples
zhlédnutí 672Před 2 lety
Python - String Splicing and Substrings Tutorial with Examples
Python - Function Documentation using docstring and help() - Code Example - Learn Python Coding
zhlédnutí 3,9KPřed 2 lety
Python - Function Documentation using docstring and help() - Code Example - Learn Python Coding
Python - Multiple Function Output and Unpacking - Code Example - Python Tutorial Videos APPFICIAL
zhlédnutí 5KPřed 2 lety
Python - Multiple Function Output and Unpacking - Code Example - Python Tutorial Videos APPFICIAL

Komentáře

  • @xelaonerom
    @xelaonerom Před 8 dny

    If you input character, what well happen?

  • @mrparkerdan
    @mrparkerdan Před 19 dny

    instead of composite key, can you just create another ID# for Marshall Mathers? (i.e. 40554)

  • @michael_fsanchez
    @michael_fsanchez Před měsícem

    6 years and in 2024 it help me, thank you!.

  • @sumonadas3640
    @sumonadas3640 Před měsícem

    LOve your demonstration

  • @vamsikuna7273
    @vamsikuna7273 Před 2 měsíci

    Thank you sir i have clear the my problem because of your video.......😊😊

  • @AnuragKumar-mz8jr
    @AnuragKumar-mz8jr Před 2 měsíci

    thanks sir

  • @28santagabo
    @28santagabo Před 2 měsíci

    super helpful! thanks

  • @ZacharyCalvert-u2b
    @ZacharyCalvert-u2b Před 2 měsíci

    How the hell did you just explain in 5 minutes what I've been unable to learn from my instructors in 5 days?

    • @Appficial
      @Appficial Před 2 měsíci

      Your instructor sucks lol

  • @mkamaal1000
    @mkamaal1000 Před 3 měsíci

    thanks. explanation was simple, easy yet important

  • @Ri_sab55
    @Ri_sab55 Před 3 měsíci

    I found your channel today and been binge watching your java tutorials and OMG such great content, please keep making these

    • @Appficial
      @Appficial Před 3 měsíci

      Thank you, I plan on making more soon!

  • @rockybalboa6969
    @rockybalboa6969 Před 4 měsíci

    nice best

  • @elisakao8462
    @elisakao8462 Před 4 měsíci

    my good man you're really saving my finals

  • @ItsPouring
    @ItsPouring Před 4 měsíci

    How much do you R🎸CK! Thank you!

  • @user-ig2kn8em3p
    @user-ig2kn8em3p Před 4 měsíci

    Subbed legit just for this, i finally get it

  • @PlumpLumps
    @PlumpLumps Před 5 měsíci

    in the parameters, what do "a" and "s" mean?

  • @Anuwhisper
    @Anuwhisper Před 5 měsíci

    thankyouuuuuuuuuuu so much

    • @Appficial
      @Appficial Před 5 měsíci

      Yoooourrrwelllcoooooooooome!

  • @beboguerra
    @beboguerra Před 5 měsíci

    Perfect, helped me understand the only thing I was confused about in class today. ty.

  • @MFM88832
    @MFM88832 Před 5 měsíci

    Thank you for the wonderful and informative video! I finally get it...

  • @catharperfect7036
    @catharperfect7036 Před 6 měsíci

    var result = (Math.abs(a - b) < EPSILON) ? "Same" : "Not the same"; System.out.println(result);

  • @catharperfect7036
    @catharperfect7036 Před 6 měsíci

    Sexy.

  • @muhammedsagar6960
    @muhammedsagar6960 Před 6 měsíci

    Thanks man I've been trying to figure this out for a while.

  • @Someone-u-dont-need-to-know

    amazingi videos

  • @user-oq6hn7cl9w
    @user-oq6hn7cl9w Před 6 měsíci

    The tutorial is well-made. Thanks.

  • @abdikhabirmohammed455
    @abdikhabirmohammed455 Před 7 měsíci

    Simple and good explanation

  • @cruely8182
    @cruely8182 Před 7 měsíci

    Great video ,keep it up.

  • @jacksondaniels007
    @jacksondaniels007 Před 7 měsíci

    Thank you so much for publishing this video. You did an excellent job of explaining these concepts.

  • @pendago8484
    @pendago8484 Před 7 měsíci

    It makes sense when on the right you find something like ++a. In that case a will, or won't increment.

  • @markli9137
    @markli9137 Před 7 měsíci

    very helpful, thank you

  • @helmangreey2138
    @helmangreey2138 Před 7 měsíci

    u r the best!

  • @vyrensc
    @vyrensc Před 7 měsíci

    Thanks!

  • @hzhuni8525
    @hzhuni8525 Před 7 měsíci

    Thank you❤ Respect from Türkiye😊

  • @sadaqat4339
    @sadaqat4339 Před 8 měsíci

    thanks a lot You helped me with it because I was struggling with the subject at university 💕💕

  • @1HourBule
    @1HourBule Před 8 měsíci

    This is what it sounds like when you have no idea what you are talking about. Why would you even post this. CZcams should take down videos like.

  • @moussatigui5314
    @moussatigui5314 Před 8 měsíci

    Literally the best one who can explain Abstract class and Interface incredibly

  • @k.s.sreenivasanharshitha2128

    Understood ... Thanks❤

  • @reecord2
    @reecord2 Před 9 měsíci

    I cannot tell you how useful this video was, thank you.

  • @NISHIKUMARI-xp4he
    @NISHIKUMARI-xp4he Před 9 měsíci

    Thanks a ton sir

  • @deniz-yl6ck
    @deniz-yl6ck Před 9 měsíci

    dont accent its not cooler

  • @SashaGalashka
    @SashaGalashka Před 9 měsíci

    Thank you for this Java Course. I wish i was able to iterate through all your videos and hit like button (cause it is so exciting, i don't leave fullscreen mode)

    • @Appficial
      @Appficial Před 9 měsíci

      lol I would appreciate if ya did

  • @juice787
    @juice787 Před 10 měsíci

    I spent hours searching online t’il I finally found your video and all I had to do is remove the second int from int age

  • @bigheart8571
    @bigheart8571 Před 10 měsíci

    Thanks for the clarification. I was reading a book and I couldn't fully understand this.

  • @laser4887
    @laser4887 Před 10 měsíci

    Thanks!

  • @kaleblitster4254
    @kaleblitster4254 Před 10 měsíci

    Amazing! You helped me understand a IsA relationship better in under three minutes then an enitre chapter in my book. Thank you!

  • @shanganoaman18
    @shanganoaman18 Před 10 měsíci

    Why when use static keyword just change the first value and don’t print the 195.15 and don’t change the second value and normal printed?

  • @dllm3tommy741
    @dllm3tommy741 Před 11 měsíci

    Thanks for the video

  • @Junobie
    @Junobie Před 11 měsíci

    bro come back

    • @Appficial
      @Appficial Před 11 měsíci

      Appreciate it bro, New videos coming soon

  • @abdullahadnan1750
    @abdullahadnan1750 Před 11 měsíci

    very good video

  • @bethelalbor
    @bethelalbor Před 11 měsíci

    What if you need to prompt an "invalid answer" if the user doesn't answer with yes or no then go back to the question again?

    • @Appficial
      @Appficial Před 11 měsíci

      Then you wouldn’t need a loop

  • @Johnweely
    @Johnweely Před 11 měsíci

    Hi, can you please help me with my code

  • @britishbavarian4592
    @britishbavarian4592 Před 11 měsíci

    Thank you! simplest explanation i've seen so far.