Question: The program will continue asking the user for IP addresses until they enter a q or Q to exit the program. Here's pseudocode to

The program will continue asking the user for IP addresses until they 

The program will continue asking the user for IP addresses until they enter a q or Q to exit the program. Here's pseudocode to help you solve this problem: # Ask the user to input an IP address or 'Q' to quit # while the user has not entered 'Q' or 'q' to quit #split the user input at each period and store the parts in a list #if there are not 4 parts in the list #display an error message # else #set error flag to False # for each part in the list. # if the part is not a number or if it is not between 0 and 255 #display an error message #set error flag to True break the loop #if no error has been displayed (i.e., error flag is False) replace each period in the user input with a colon #display the new formatted IP address # ask the user to input an IP address or 'Q' to quit You may want to consider copying the above pseudocode into your Python file and use it as comments that can also guide you as you write this program. Sample output: Please enter an IP address or 'Q' to quit: 122.44.33 Error: An IP address should consist of 4 parts separated by periods. Please enter an IP address or 'Q' to quit: 122.44.33.x Error with x: Each part of the IP address should be a number between 0 and 255. Please enter an IP address or 'Q' to quit: 122.444.33.x Error with 444: Each part of the IP address should be a number between 0 and 255. Please enter an IP address or 'Q' to quit: 122.44.33.89 Reformatted IP address: 122:44:33:89 Please enter an IP address or 'Q' to quit: q

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!