Repository: Python-World/python-mini-projects
File: projects/Unstructured Supplemenrary  Service Data/ussdtim.py (Python)

Code before:
	acc_num= input("Entet account number:")
	print("Sending to",acc_num)
	hash= input("1.Press # to go back to options menu\n2. Press * to go exit.")
	if hash == "#":
	   options_menu( )
	elif hash == "*":
	    exit( )
	else:
														sys.exit( )											

																#--------------------------------------------------												
###i'm yet to catch an error for non -digit and more than one digit###REMINDER!!!						#-#------------------------------------------------------								
# This is the function for options.
def options_menu( ) :
	print("1. Open Account\n2. Upgrade/Migrate\n3. Balance\n4. Transfer\n5. Funds")
	choice=input("Enter an option:")
	if choice == "1":
		time.sleep(10)
		open_acct( )
	elif choice == "2":
		time.sleep(10)
		upgrade_migrate( )
	elif choice =="3":
		time.sleep(10)
		balance( )
	elif choice =="4":
		time.sleep(10)
		transf( )
	elif choice =="5":
		time.sleep(10)
		funds( )
	else:
		time.sleep(5)
		print("Not an option.")
		sys.exit( )
		
# This is the function which prompts the user as to whether the user wishes to continue or stop transaction.
def exit( ):
	exit= input("Do you wish to make another transaction [Y/N] :")
	if exit== "N":
		sys.exit( )
	elif exit == "#":
	    options_menu( )
	else:
		log_in( )
		
# This is the function for logging using the fast code *919#			
def log_in( ):
    try:
        a=0
        while a<3:

Review comment (suggestion):
```python
	choice=input("Enter an option:")
	if choice == "1":
		time.sleep(10)
		open_acct( )
	elif choice == "2":
		time.sleep(10)
		upgrade_migrate( )
	elif choice =="3":
		time.sleep(10)
		balance( )
	elif choice =="4":
		time.sleep(10)
		transf( )
	elif choice =="5":
		time.sleep(10)
		funds( )
	else:
		time.sleep(5)
		print("Not an option.")
		sys.exit( )
```

Alternative to  write multiple if else conditions
```python

select_options ={
	  '1':open_acct,
	  '2':upgrade_migrate,
	  '3': balance,
	  '4':transf,
	  '5':funds
}
choice=input("Enter an option:")
if select_options.get(choice):
  select_options[choice]()
else:
  sys.exit()

```

Code after:
def funds( ):
	time.sleep(3)
	print(bank_list)
	bnk = input("Select receipients Bank:")
	acc_num= input("Entet account number:")
	print("Sending to",acc_num)
	hash= input("1.Press # to go back to options menu\n2. Press * to go exit.")
	if hash == "#":
	   options_menu( )
	elif hash == "*":
	    exit( )
	else:
														sys.exit( )											

																#--------------------------------------------------												
###i'm yet to catch an error for non -digit and more than one digit###REMINDER!!!						#-#------------------------------------------------------								
# This is the function for options.
def options_menu( ) :
	print("1. Open Account\n2. Upgrade/Migrate\n3. Balance\n4. Transfer\n5. Funds")
	select_options ={
	  '1':open_acct,
	  '2':upgrade_migrate,
	  '3': balance,
	  '4':transf,
	  '5':funds}
	choice=input("Enter an option:")
	if select_options.get(choice):
	   select_options[choice]()
	else:
		sys.exit()
		
# This is the function which prompts the user as to whether the user wishes to continue or stop transaction.
def exit( ):
	exit= input("Do you wish to make another transaction [Y/N] :")
	if exit== "N":
		sys.exit( )
	elif exit == "#":
	    options_menu( )
	else:
		log_in( )
		
# This is the function for logging using the fast code *919#			
def log_in( ):
    try:
        a=0
        while a<3:
            a+=1
            USSD=input("ENTER USSD:")
            if(USSD !="*919#"):
            	 print("please re-enter USSD ...")
            else: