Friday, February 1, 2019

Length of List

  • Problem Description

    Write a program to find the length of the list

    Input:

    1. The Size of First List
    2. The Size of Second List
    3. First List elements
    4. Second List elements

    Output:
    1. Length of First List
    2. Length of Second List
    3. First List Data
    4. First List Data

    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=int(input())
    b=int(input())
    print("Length of First List",a)
    print("Length of Second",b)
    print("First List Data")
    for i in range(a):
        x=input()
        print(x)
    print("Second List Data")
    for i in range(b):
        x=input()
        print(x)
  • Test Case 1

    Input (stdin)
    2
    
    2
    
    67
    
    91
    
    67
    
    91
    
    
    Expected Output
    Length of First List 2
    
    Length of Second 2
    
    First List Data
    
    67
    
    91
    
    Second List Data
    
    67
    
    91
  • Test Case 2

    Input (stdin)
    3
    
    3
    
    25
    
    9
    
    eLab
    
    Tool
    
    2017
    
    Evaluation
    
    
    Expected Output
    Length of First List 3
    
    Length of Second 3
    
    First List Data
    
    25
    
    9
    
    eLab
    
    Second List Data
    
    Tool
    
    2017
    
    Evaluation

No comments:

Post a Comment