Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mixed function
#1
My final work is to add elements that I used so far in different programs. I wrote this code:

def str_analysis(argstr):
    
    if argstr.isdigit() > 100:
        if argstr.isdigit() > 1000:
            print("We have a big number!")
        else:
            print("we have a moderately big number")
    elif argstr.isdigit() < 100:
        print("We have a small number!")
    elif argstr.isalpha():
        print("We have all alphabetic!")
    else:
        print("We have multiple character type")
str_analysis(input("Add string: "))
What ever input I give it prints "We have a small number!". Don't understand why.
Reply


Messages In This Thread
Mixed function - by Truman - Jan-19-2018, 11:25 PM
RE: Mixed function - by Mekire - Jan-19-2018, 11:32 PM
RE: Mixed function - by j.crater - Jan-19-2018, 11:32 PM
RE: Mixed function - by Truman - Jan-20-2018, 10:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sorting digits in a mixed string snorri 1 1,688 Apr-22-2020, 11:04 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020