By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,816 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,816 IT Pros & Developers. It's quick & easy.

How can i filter a numbers using wild characters.

P: 1
Hi Experts!

I am trying to build a small python program. My query is how to differentiate b/w numbers- For eg-

print("Enter Number: ") #For eg- 3507,3508,3513,3514#
a = int(input())
if (a%2!=0): #For odd no.#
print("log in ??43 or ??49")
#How can I use first 2 digits here i.e ??43 or ??49#

if a == ????: #Which statement should I use for 3507 to print below statement
print("MgrCli -g -e 1")

if a == ????: #Which statement should I use for 3513 to print below statement
print("MgrCli -g -s 2")
2 Weeks Ago #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 619
Expand|Select|Wrap|Line Numbers
  1. #How can I use first 2 digits here i.e ??43 or ??49#
  2. number = 1243
  3. print(divmod(number, 100))
Next, fix your input statement. Trying to convert a list to an int will throw an error. There are many examples on the web
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.