Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mixed function
#4
Thank you for the explanation, I adjusted the code to:

def str_analysis(argstr):
     
    if argstr.isdigit():
        if int(argstr) >= 1000:
            print("We have a big number!")
        else:
            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: "))
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