<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <h1 align="center">Complex Conditional Statements<h1>
<h2>01.Personal Titles</h2>
The first task of this topic is to write a console program that **introduces age** (decimal number) and **gender** ("m" or "f") and **prints an address** from among the following
Step1:  <h2>02.Small Shop</h2>
Problem
Step2:  <h2>03.Point in Rectangle</h2>
Problem
Step3:  <h2>04.Fruit or Vegetable</h2>
Problem
Step4:  <h2>05.Invalid Number</h2>
Problem
Step5:  <h2>06.Point on Rectangle Border</h2>
Problem
Step6:  <h2>07.Fruit Shop</h2>
Problem
Step7:  <h2>08.Trade Comissions</h2>
Problem
Step8:  <h2>09.Day of Week</h2>
Problem
Step9:  <h2>10.Animal Type</h2>
Problem
Step10:  <h2>11.Cinema</h2>
Problem
Step11:  <h2>12.Volleyball</h2>
Problem
Step12:  <h2>13.Point in the Figure</h2>
Problem
<ASSISTANT_TASK:>
Python Code:
age = float(input())
sex = input()
if sex == "m":
    if age >= 16:
        print("Mr.")
    else:
        print("Master")
else:
    if age >= 16:
        print("Ms.")
    else:
        print("Miss")
Explanation: <h1 align="center">Complex Conditional Statements<h1>
<h2>01.Personal Titles</h2>
The first task of this topic is to write a console program that **introduces age** (decimal number) and **gender** ("m" or "f") and **prints an address** from among the following:
-> "Mr." - male (gender "m") aged 16 or over
-> "Master" - boy (sex "m") under 16 years of age
-> "Ms." - woman (gender "f") aged 16 or over
-> "Miss" - girl (gender "f") under 16 years of age
End of explanation
product = input()
city = input()
quantity = float(input())
price = 0
if city == "Sofia":
    if product == "coffee":
       price = quantity * 0.50
    elif product == "water":
        price = quantity * 0.80
    elif product == "beer":
        price = quantity * 1.20
    elif product == "sweets":
        price = quantity * 1.45
    elif product == "peanuts":
        price = quantity * 1.60
elif city == "Plovdiv":
    if product == "coffee":
       price = quantity * 0.40
    elif product == "water":
        price = quantity * 0.70
    elif product == "beer":
        price = quantity * 1.15
    elif product == "sweets":
        price = quantity * 1.30
    elif product == "peanuts":
        price = quantity * 1.50
elif city == "Varna":
    if product == "coffee":
       price = quantity * 0.45
    elif product == "water":
        price = quantity * 0.70
    elif product == "beer":
        price = quantity * 1.10
    elif product == "sweets":
        price = quantity * 1.35
    elif product == "peanuts":
        price = quantity * 1.55
print(float("{0:.2f}".format(price)))
Explanation: <h2>02.Small Shop</h2>
Problem:
The next task is to work with nested if.
Here is the condition: enterprising Bulgarian opens neighborhood shops in several cities and    sells at different prices:
|  city / product | coffee  |water| beer  |  sweet |  peanuts |
|---|---|---|---|---|---|
|  Sofia |  0.50  |  0.80 | 1.20  | 1.45   |  1.60  |
|  Plovdiv |  0.40 | 0.70  | 1.15  | 1.30  | 1.50  |
|  Varna | 0.45  |   0.70 |  1.10 | 1.35  | 1.55  |
Write a program that reads from the console city (string),product (string) and quantity (decimal number), and calculates and prints how much the corresponding quantity of the selectedproduct costs in that city.
The answer to be accurate to the second character.
End of explanation
x1 = float(input())
y1 = float(input())
x2 = float(input())
y2 = float(input())
x = float(input())
y = float(input())
if x >= x1 and x <= x2 and y >= y1 and y <= y2:
    print("Inside")
else:
    print("Outside")
Explanation: <h2>03.Point in Rectangle</h2>
Problem:
Write a program that checks whether the point {x, y} is located in a rectangle {x1, y1} - {x2, y2}.
The input data is read from the console and consists of 6 rows: the decimal numbers x1, y1, x2, y2, x and y (taking ensure that x1 <x2 and y1 <y2). One point is internal to a rectangle if it is located somewhere in
its interior or on one of its sides. 
Print "Inside" or "Outside".
End of explanation
product = input()
if product == "banana":
    print("fruit")
elif product == "apple":
    print("fruit")
elif product == "kiwi":
    print("fruit")
elif product == "cherry":
    print("fruit")
elif product == "lemon":
    print("fruit")
elif product == "grapes":
    print("fruit")
elif product == "tomato":
    print("vegetable")
elif product == "cucumber":
    print("vegetable")
elif product == "pepper":
    print("vegetable")
elif product == "carrot":
    print("vegetable")
else:
    print("unknown")
Explanation: <h2>04.Fruit or Vegetable</h2>
Problem:
Write a program that introduces a product name and checks whether it is a fruit or a vegetable.
-> Fruit are: banana, apple, kiwi, cherry, lemon and grapes
-> Vegetables  are: tomato, cucumber, pepper and carrot
->  All others are unknown ;
Display "fruit", "vegetable" or "unknown" according to the introduced product.
End of explanation
num = float(input())
if num == 0 or (num >= 100 and num <= 200):
    print()
    
else:
    print("invalid")
Explanation: <h2>05.Invalid Number</h2>
Problem:
A given number is valid if it is in the range [100 ... 200] or is 0.
Write a program that enters a whole number and print "invalid" if the entered number is not valid.
End of explanation
x1 = float(input())
y1 = float(input())
x2 = float(input())
y2 = float(input())
x = float(input())
y = float(input())
if ((( y == y1 or y == y2)and (x1 <= x and x <= x2))) or ((x == x1 or x == x2)and (y1 <= y and y <= y2)):
    print("Border")
else:
    print("Inside / Outside")
Explanation: <h2>06.Point on Rectangle Border</h2>
Problem:
Write a program that checks whether the point {x, y} is located on either side of a rectangle {x1, y1} - {x2, y2}.
The input data is read from the console and consists of 6 rows: the decimal numbers x1, y1, x2, y2, x and y (ensuring that x1 <x2 and y1 <y2).
Print "Border" (the point lies on one side)or "Inside / Outside" (otherwise).
End of explanation
fruit = input()
day = input()
quantity = float(input())
price = 0
valid_Day = day == "Monday" or day == "Tuesday" or\
            day == "Wednesday" or day == "Thursday" or\
            day == "Friday"
if day == "Saturday" or day == "Sunday":
        if fruit == "banana":
            price = quantity * 2.70
            print(price)
        elif fruit == "apple":
            price = quantity * 1.25
            print(price)
        elif fruit == "orange":
            price = quantity * 0.90
            print(price)
        elif fruit == "grapefruit":
            price = quantity * 1.60
            print(price)
        elif fruit == "kiwi":
            price = quantity * 3.00
            print(price)
        elif fruit == "pineapple":
            price = quantity * 5.60
            print(price)
        elif fruit == "grapes":
            price = quantity * 4.20
            print(price)
            
        else:
            print("error")
elif valid_Day:
    if fruit == "banana":
            price = quantity * 2.50
            print(price)
    elif fruit == "apple":
            price = quantity * 1.20
            print(price)
    elif fruit == "orange":
            price = quantity * 0.85
            print(price)
    elif fruit == "grapefruit":
            price = quantity * 1.45
            print(price)
    elif fruit == "kiwi":
            price = quantity * 2.70
            print(price)
    elif fruit == "pineapple":
            price = quantity * 5.50
            print(price)
    elif fruit == "grapes":
            price = quantity * 3.85
            print(price)
    else:
        print("error")
else:
    print("error")
    
Explanation: <h2>07.Fruit Shop</h2>
Problem:
The fruit shop during the working days works at the following prices:
| fruit |  banana |  apple |  orange |  grapefruit | kiwi  | pineapple  | grapes  |
|---|---|---|---|---|---|---|---|
| price  | 2.50  | 1.20  | 0.85  |  1.45 | 2.70  | 5.50   | 3.85  |
Saturday and Sunday the shop runs at higher prices:
| fruit |  banana |  apple |  orange |  grapefruit | kiwi  | pineapple  | grapes  |
|---|---|---|---|---|---|---|---|
|  price |   2.70   |  1.25  |   0.90 | 1.60  | 3.00   |   5.60 |  4.20  |
Write a program that reads from the fruit console (banana / apple / orange / grapefruit / kiwi / pineapple /grapes), day of the week (Monday / Tuesday / Wednesday / Wednesday / Friday / Saturday / Sunday) and quantity(decimal number) and calculate the price according to the prices in the tables above.
Print the result rounded by 2 digits after the decimal point.
Invalid day of the week or invalid fruit name to print "error".
End of explanation
city = input()
sales = float(input())
commission = 0
commission_Percent = 0
if city == "Sofia":
    if 0 <= sales <= 500:
        commission_Percent = 0.05
    elif 500 <= sales <= 1000:
        commission_Percent = 0.07
    elif 1000 <= sales <= 10000:
        commission_Percent =  0.08
    elif sales > 10000:
        commission_Percent = 0.12
elif city == "Varna":
    if 0 <= sales <= 500:
        commission_Percent = 0.045
    elif 500 <= sales <= 1000:
        commission_Percent = 0.075
    elif 1000 <= sales <= 10000:
        commission_Percent =  0.10
    elif sales > 10000:
        commission_Percent = 0.13
    else:
        print("error")
elif city == "Plovdiv":
    if 0 <= sales <= 500:
        commission_Percent = 0.055
    elif 500 <= sales <= 1000:
        commission_Percent = 0.08
    elif 1000 <= sales <= 10000:
        commission_Percent =  0.12
    elif sales > 10000:
        commission_Percent = 0.145
    else:
        print("error")
else:
    print("error")
commission = sales * commission_Percent
print(float("{0:.2f}".format(commission)))
Explanation: <h2>08.Trade Comissions</h2>
Problem:
The company gives the following commissions to its merchants according to the town in which the sales volume works:
| City  |  0 ≤ s ≤ 500 |  500 < s ≤ 1,000 |   1,000 < s ≤ 10,000 | s > 10 000  |
|---|---|---|---|---|
| Sofia  | 5%  |  7% |  8%  | 12%  |
|  Varna |  4.5%   |  7.5%  |  10% | 13%  |
| Plovdiv  | 5.5%  | 8%  |  12% |  14.5% |
Write a console program that reads a city name and sales volume (decimal number) and calculates and returns the amount of merchant commission according to the above table.
Score to be rounded by 2 digits after the decimal point.
In the case of an invalid city or sales volume (negative number) prints "error".
End of explanation
num = float(input())
if num == 1:
    print("Monday")
elif num == 2:
    print("Tuesday")
elif num == 3:
    print("Wednesday")
elif num == 4:
    print("Thursday")
elif num == 5:
    print("Friday")
elif num == 6:
    print("Saturday")
elif num == 7:
    print("Sunday")
else:
    print("error")
Explanation: <h2>09.Day of Week</h2>
Problem:
Print the name of the day of the week by day of the day from [1 ... 7] or
print an "Error" for an invalid number.
End of explanation
animal = input()
if animal == "dog":
    print("mammal")
elif animal == "crocodile" or animal == "snake" or animal == "tortoise":
      print("reptile")
else:
    print("unknown")
Explanation: <h2>10.Animal Type</h2>
Problem:
Write a program that prints the animal's class according to its user name:
-> dog  -> mammal
-> crocodile, tortoise, snake -> reptiles
-> others -> unknown
End of explanation
projections_Type = input()
row = int(input())
cow = int(input())
tickets_Price = 0
total_Price = 0
if projections_Type == "Premiere":
    tickets_Price = 12
elif projections_Type == "Normal":
    tickets_Price = 7.5
elif projections_Type == "Discount":
    tickets_Price = 5
total_Price = tickets_Price * (row * cow)
print("{0:.2f} leva".format(total_Price))
Explanation: <h2>11.Cinema</h2>
Problem:
In one cinema hall, the chairs are arranged in rectangular shape in r row and c columns.
There are three types of projections with Tickets at different rates:
-> Premiere - Premiere, at a price of 12.00 BGN.
-> Normal - standard screening, at a price of 7.50 leva.
-> Discount - screening for children, students and students at a reduced price of 5.00 BGN.
Write a program that introduces a screen type, number of rows, and number of columns in the room numbers) and calculates total ticket revenue in a full room.
Print the result in a format such as the examples below, with 2 decimal places.
End of explanation
import  math
years_Type = input()
holidays = int(input())
weekends = int(input())
times = 0
weekends_games = 0
games_in_Sofia = 0
if years_Type == "normal":
    weekends_games = (48 - weekends) * ( 3 / 4)
    games_in_Sofia = holidays * (2/3)
    times = weekends_games + games_in_Sofia + weekends
    print(math.floor(times))
elif years_Type == "leap":
     weekends_games = (48 - weekends) * ( 3 / 4)
     games_in_Sofia = holidays * (2/3)
     times = weekends_games + games_in_Sofia + weekends
     times += 0.15 * times
     print(math.floor(times))
Explanation: <h2>12.Volleyball</h2>
Problem:
Vladi is a student, lives in Sofia and walks from time to time to his hometown.
He is very keen on volleyball but busy during business days and playing volleyball only on weekends and holidays.
Vladi plays in Sofia every Saturday when he is not at work and does not travel to his hometown, as well as in 2/3 of festive days.
He travels to his hometown h times in the year where he plays volleyball with his old ones friends on Sunday.
Vladi is not at work 3/4 of the weekends he's in Sofia.
Separately, through the leeches years Vladi plays with 15% more volleyball than normal.
We assume that the year has exactly 48 weekends,suitable for volleyball.
How many times , he played during the year
End of explanation
h = int(input())
x = int(input())
y = int(input())
left_square = (0 < x <= h) and (0 < y < h)               # Is the point in the left square.
mid = (h < x < 2 * h) and (0 < y < 4 * h)               # Is the point in the middle cow.
right_square = (2 * h <= x < 3 * h) and (0 < y < h)      # Is the point in the right square.
left_squares_borders = (x == 0 and 0 <= y <= h)or\
                       (y == h and 0 <= x <= h)         # Is the point on the left squares border.
down_border = (y == 0 and 0 <= x <= h * 3)
right_squares_borders = (x == h * 3 and 0 <= y <= h)or\
                        (y == h and 2 * h <= x <= 3 * h)  # Is the point on the right squares border.
mid_borders = (x == 2 * h and h <= y <= 4 * h)or\
              (x == h and h <= y <= 4 * h)
top_border = (y == 4 * h and h <= x <= 2 * h)
inside = left_square or mid or right_square
border = left_squares_borders or right_squares_borders or\
         down_border or mid_borders or top_border
if inside:
    print("inside")
elif border:
    print("border")
else:
    print("Outside")
Explanation: <h2>13.Point in the Figure</h2>
Problem:
Figure consists of 6 blocks of size h * h, located as in the figure on the right.
Lower left corner of the building is in position {0, 0}.
The upper right corner of the figure is in position {2 * h, 4 * h}.
In the figure the coordinates are given at h = 2.
Write a program that enters integer h and coordinates
a point {x, y} (integers) and prints whether the point is inside
the inside, outside the figure, or on any of the sides of the border.
End of explanation
<END_TASK>