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

  • Picking the best hotel

    Picking hotels is sometimes very time-consuming. That’s why you’ve decided to write a program that would help you narrow down the search. You know that there are n hotels in general. You know their distance from the city center and the cost. You either want a hotel that is very far away from the city center and is not expensive or a hotel that is in the city center.
    • You’ve decided that you’d consider the hotel in the city center if its distance from the central square is ≤ 100.
    • You’ve decided that the hotel is far from the city if its distance is ≥ 1000.
    • The hotel is considered cheap if the price is less than 40 per night.
    The first line of the input contains a single integer n - the number of hotels. The next lines have the following structure, first comes the name of the hotel, then the distance from the central square, then its price.
    The output of the program should contain a list of hotels that satisfy your needs (each on a separate line).
    Input
    Output
    3 Waves 5000 30 Central 10 1000 Rocks 1500 50
    Waves Central
     
    To check your solution you need to sign in
    Sign in to continue