First, watch the demo video below. Your task is to code something like this, and use the code below to get started
You can either edit and code online in repl.it or you can simply cut and paste the below into your own python file
#TASK #a common mistake that students make is to add a space by mistake when entering their password #create a program that #asks the user for their password #if they put in a blank space anywhere, REMOVE IT #"acecss granted" as long as the password is right without the blank spaces #The following code removes the trailing and leading white spaces but not the ones in between. Can you fix it? #Hint: Use "replace" to replace ALL blank spaces in the string def main(): password=input("What is your password:?") password=password.strip() if password=="open123": print("access granted") else: print("sorry denied") main()
A sample flow chart (design) for this particular challenge could look like:
Test No. | Description | Test Data(input) | Expected Outcome | Actual Outcome | Further Action? |
---|---|---|---|---|---|
1 | |||||
2 | |||||
3 | |||||
4 | |||||
5 |