Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Exercise: Repetition and Concatenation

Sumit Rawal answered on May 16, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Solution Review: Repetition and Concatenation

  • Exercise: Repetition and Concatenation

    0

    Problem Statement

    In this exercise, you must implement the rep_cat function. You are given two integers, x and y, as arguments. You must convert them into strings. The string value of x must be repeated 10 times and the string value of y must be repeated 5 times.

    At the end, y will be concatenated to x and the resulting string must returned.

    Sample Input

    x = 3

    y = 4

    Sample Output

    '333333333344444'

    Coding Challenge

    Take some time to figure out the logic behind this problem before jumping to the implementation. The function skeleton has been created. You only need to write code in its body.

    The pass statement can be erased and replaced with your return statement.

    If you get stuck, feel free to check out the solution review in the next lesson.

    Good luck! 

    Popularity 1/10 Helpfulness 1/10 Language python
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 16 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.