fb pixel

Introduction to Python

  • Profound Academy

    • Status
      • 1
        Input and Output
      • 2
        Variables and Integer Arithmetic
      • 3
        Conditional Operators
      • 4
        Advanced Conditions - Nesting
      • 5
        Types and Variables
      • 6
        Strings
      • 7
        Lists
      • 8
        For Loops
      • 9
        While Loops
      • 10
        continue, break, while...else
      • 11
        String and List methods
      • 12
        Nested Loops
      • 13
        List Comprehension
      • 14
        Tuples and Sets
      • 15
        dict
      • 16
        Functions
      • 17
        Functions 2
      • 18
        Lambda and higher-order functions
      • 19
        Files

  • Football

    In the history of El Clasico, both Barcelona and Real Madrid have had victories and defeats. By looking at historical records, we are trying to understand who won in each game. It’s hard to read numbers, so you’re asked to write a program that would print Barcelona won the game if Barcelona scored higher than Real Madrid, and Real Madrid won the game if Real Madrid scored higher. In case of an equal score, the program should print It was a draw.
    notion image
    The input consists of two numbers. First is the score of Barcelona and second is the score of Real Madrid. Print the appropriate message for the game.
    Input
    Output
    4 0
    Barcelona won the game
    1 11
    Real Madrid won the game
    To check your solution you need to sign in
    Sign in to continue