Hi, this program is working atm but i suck at loops and such and im just wondering if there is any better way to do it, and if i do not enter a number in 1 of the 3 boxes when showing the results of the networks it just says "is not a valid mobile network", im wondering whats the best way to just show a blank if no number is entered thanks!
#imports easygui
import easygui
runprog = "yes"
#Set promts for multenterbox
promt = "Enter the mobile numbers"
title = "Moble number checker"
#Set lists for multenterbox fields
fields = ["First number", "Second number", "Third number"]
userInput = []
#Set list for networks
networks = ["083", "085", "086", "087"]
while runprog == "yes":
#Get user inputs
userInput = easygui.multenterbox(promt,title,fields)
#Split user input list into variables
no1 = userInput[0]
no2 = userInput[1]
no3 = userInput[2]
Net1 = no1[0:3]
Net2 = no2[0:3]
Net3 = no3[0:3]
#Matches Userinput[0] with a network and displays what network it is on
if Net1 == networks[0]:
easygui.msgbox(no1 + "\t" "Is on the 3 Ireland network")
elif Net1 == networks[1]:
easygui.msgbox(no1 + "\t" "Is on the Meteor network")
elif Net1 == networks[2]:
easygui.msgbox(no1 + "\t" "Is on the 02 network")
elif Net1 == networks[3]:
easygui.msgbox(no1 + "\t" "Is on the Vodafone network")
else:
easygui.msgbox(no1 + "\t" "Is an invalid mobile network number")
#Matches Userinput[1] with a network and displays what network it is on
if Net2 == networks[0]:
easygui.msgbox(no2 + "\t" "Is on the 3 Ireland network")
elif Net2 == networks[1]:
easygui.msgbox(no2 + "\t" "Is on the Meteor network")
elif Net2 == networks[2]:
easygui.msgbox(no2 + "\t" "Is on the 02 network")
elif Net2 == networks[3]:
easygui.msgbox(no2 + "\t" "Is on the Vodafone network")
else:
easygui.msgbox(no2 + "\t" "Is an invalid network number")
#Matches Userinput[2] with a network and displays what network it is on
if Net3 == networks[0]:
easygui.msgbox(no3 + "\t" "Is on the 3 Ireland network")
elif Net3 == networks[1]:
easygui.msgbox(no3 + "\t" "Is on the Meteor network")
elif Net3 == networks[2]:
easygui.msgbox(no3 + "\t" "Is on the 02 network")
elif Net3 == networks[3]:
easygui.msgbox(no3 + "\t" "Is on the Vodafone network")
else:
easygui.msgbox(no3 + "\t" "Is an invalid network number")
#Ask user if they want to run the program again
runprog = easygui.enterbox("Would you like to check more mobile numbers? yes/no")