How can i filter a numbers using wild characters.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kapils
    New Member
    • Aug 2019
    • 1

    How can i filter a numbers using wild characters.

    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")
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    Code:
    #How can I use first 2 digits here i.e ??43 or ??49#
    number = 1243
    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 https://pynative.com/python-accept-l...put-from-user/

    Comment

    Working...