Friday, February 1, 2019

Biggest Idiot

  • Problem Description

    Write a Python program to find the biggest string based on the length function.

    The user should get two string inputs and compare the string

    Print the longest or biggest string in the output.

    If the strings are equal then print the message as "Both strings are equal"


    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.
  • CODING ARENA
  • a=input()
    b=input()
    if(len(a)>len(b)):
        print("Larger string is:")
        print(a)
    elif(len(a)<len(b)):
        print("Larger string is:")
        print(b)
    else:
        print("Both strings are equal")

  • Test Case 1

    Input (stdin)
    eLab Auto
    
    Evaluation Tool
    
    
    Expected Output
    Larger string is:
    
    Evaluation Tool
  • Test Case 2

    Input (stdin)
    eLab Auto
    
    elab auto
    
    
    Expected Output
    Both strings are equal

No comments:

Post a Comment