def validate_priority(priority):     '''     validate the "priority" parameter     Returns True if "priority" is a string containing a number 1-5     Returns False otherwise     '''          if (priority.isdigit()):         if (priority == 1):             return True         elif (priority == 2):             return True         elif (priority == 3):             return True         elif (priority == 4):             return True         elif (priority == 5):             return True     else:         return False   pass value for "priority" must be a string that contains a number 1-5 this is my code

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 2RQ
icon
Related questions
Question

def validate_priority(priority):
    '''
    validate the "priority" parameter
    Returns True if "priority" is a string containing a number 1-5
    Returns False otherwise
    '''
    
    if (priority.isdigit()):
        if (priority == 1):
            return True
        elif (priority == 2):
            return True
        elif (priority == 3):
            return True
        elif (priority == 4):
            return True
        elif (priority == 5):
            return True
    else:
        return False
  pass

  • value for "priority" must be a string that contains a number 1-5
  • this is my code
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT