I am trying to make an inputin() function to take all the parameters input for the first time with exception and for individual parameter for the runtime proposition. I am thus looking forward to reducing code size or being a more efficient coder with more pythonic procedures.This code is well executed and tested for all possible situationsimport turtle              # 1.  import the modules#import randomBackGround = 'white'Numside = 0Armlen = 0Turtlecolor = 'blue'Turtleshape = 'turtle'def inputin(count = 1, port = 0):            #counting for resolving runtime error    global BackGround, Numside, Armlen, Turtlecolor, Turtleshape    while True :        try :            if((port == 0 or port == count) and count == 1):                count+=1                BackGround = str(input(Enter the Background Color : ))            if((port == 0 or port == count) and count == 2):                count+=1                Numside = int(input(Enter the No. of Sides : ))            if((port == 0 or port == count) and count == 3):                count+=1                Armlen = int(input(Enter the length of each side : ))            if((port == 0 or port == count) and count == 4):                count+=1                Turtlecolor = str(input(Enter the Turtle Color : ))            if((port == 0 or port == count) and count == 5):                count+=1                Turtleshape = str(input(Enter the Turtle Shape : ))            port = -1            break        except ValueError :            print(Oops!  That was no valid number.  Try again...)            count+=-1#Creating Screen after Everything Is Over#i am creting this class for adjusting multiple values like a structure.class Team(object):    def __init__(self, Numside = 0, Armlen = 0, Turtlecolor = , Turtleshape = ):        self.Numside = Numside        self.Armlen = Armlen        self.Turtlecolor = Turtlecolor        self.Turtleshape = Turtleshapedef screen():    wn = turtle.Screen()       # 2.  Create a screen    while True:        try:            wn.bgcolor(BackGround)            break        except turtle.TurtleGraphicsError as e:            inputin(1,1)    wn.exitonclick()def TurtleCreation():    lance = turtle.Turtle()    while True:        positionInput = 0 #for marking the position of the desired input          try:            positionInput = 4            lance.color(Turtlecolor)            positionInput = 5            lance.shape(Turtleshape)            break        except turtle.TurtleGraphicsError as f:            inputin(positionInput,positionInput)    lance.speed(500)    lance.penup()    #lance.goto(-300,200)inputin()TurtleCreation()screen()#sc = turtle.ScrolledCanvas(master)#now shifting the turtle to the middle of the system
Exception handling for a chain of prompts
python;error handling;console