Question
There is one discussion you will need to participate in this week. To date, we haven't talked too much about handling possible input errors resulting
There is one discussion you will need to participate in this week.
To date, we haven't talked too much about handling possible input errors resulting from a user either accidentally or purposely entering incorrect data that is used by the program. This discussion will allow you to take some of your previous code from week 1 or week 2 and make adjustments such that input errors are handled gracefully.
Using code you developed in week 1 or week 2 and the guidance found in this document:
http://easypythondocs.com/validation.html
use one of the two methods suggested along one or more of the validation techniques provided and fix your code to gracefully and securely handle user input errors.
Just pick a smaller section of the code to fix. Provide the code before and after the fix. Be sure to demonstrate the new fix works as expected by providing screen captures.
Interact with one student and try their code fix. Comment on which method and techniques were used. Make adjustments and experiment to further demonstrate your understanding of their implementation.
Here is the code that I did in week 1(python)
""" Code to add two numbers """ X = 89 Y = 91 Z = X + Y print(Z)
""" Code to know favorite color """ fav_color = input("please enter your favorite color?") print("The color {} is a fantastic color!".format(fav_color))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started