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

  • Is baggage allowed?

    Airport terminal checks for carry-on baggage to be at most 5kg. Anything higher than that has to be fined. The passenger needs to pay 20 times the extra kilograms of baggage they carry.
    The airport asks you to automate that process.
    You are given an integer n, which represents the carry-on baggage weight of a passenger.
    If the weight does not exceed 5kg, the system should output Welcome aboard!. Otherwise, the system should print the amount the passenger needs to pay.
    Input
    Output
    10
    Please pay 100 to proceed
    4
    Welcome aboard!
     
    To check your solution you need to sign in
    Sign in to continue