Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Secure Exception Handling | Understanding Python Vulnerabilities
Python Security Best Practices

bookChallenge: Secure Exception Handling

Tarefa

Swipe to start coding

Write a function that securely handles exceptions when dividing two numbers. The function must only catch specific exceptions and must not reveal any internal error details in its return value.

  • If division is successful, return the result.
  • If a ZeroDivisionError or TypeError occurs, return the string "An error occurred. Please check your input.".
  • Do not return or expose any exception messages or stack traces.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 6
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Secure Exception Handling

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Write a function that securely handles exceptions when dividing two numbers. The function must only catch specific exceptions and must not reveal any internal error details in its return value.

  • If division is successful, return the result.
  • If a ZeroDivisionError or TypeError occurs, return the string "An error occurred. Please check your input.".
  • Do not return or expose any exception messages or stack traces.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 6
single

single

some-alt