> For the complete documentation index, see [llms.txt](https://www.pythonclassroom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pythonclassroom.com/decisions-if-elif-else/if-elif/if-else-problems.md). Agents can also search and read this documentation through its [MCP server](https://www.pythonclassroom.com/~gitbook/mcp).

# if else Problems

## Problem 1

Write Python code that asks a user for two numbers. Print the number that is the greatest. Print the number that is the least.

## Problem 2

Write Python code that asks a user for their password. If the user enters “1234567890”, print “that password is really easy to guess”.

Else print “good enough, I guess”.

## Problem 3

Write Python code that asks a user for their temperature. If the temperature is 100.4 or more, print “you have a fever”.

Else print “normal temperature”

## Problem 4

Write Python code that asks a user how many degrees is it in the Building. If the temperature is less than or equal to 70, print “feels chilly”.

Else print “comfy”.

## Problem 5

The USEPA developed the Air Quality Index (AQI) to report daily air quality to the public. The AQI tells you how clean your local air is, and what associated health effects might be a concern in your area. Think of the AQI as a yardstick that runs from 0 to 300. The higher the AQI value, the greater the level of air pollution and the greater the health concern.

Write Python code that asks a user what the AQI is today. If the user enters, 50 or less, print “Air Quality is Good”. Else print, “Air Quality is Moderate or Unhealthy”.

## Problem 6

Write Python code that asks a user how many pizza slices they want. The pizzeria charges $1.25 a slice if you order 10 slices or less and $1 a slice if you order more than 10 slices.

Print the total price depending on how many slices you order.

(Note: do not use the $ when assigning the price in your Python code)

## Problem 7

Write Python code that asks a user how many Youtube videos they watch per day. The average video is 7 minutes. If the user enters 5 or more, print “you watch a lot of videos”.

Else print “get more sleep”.

Print the total number of minutes the user watches videos.

## Problem 8

Write Python code that asks a user do you have a ShopRite card? Next, ask how many Apple or Pumpkin pies do they want to buy.

If the user enters “yes”, the user is charged 2.99 per pie. Else, the user is charged 4.99 per pie.

Print the total price.

## Problem 9

Write Python code asks the user for a number. If the number is divisible by 5, print the number if it is divisible by 5. Else print the number is not divisible by 5.

## Problem 10

Write Python code that asks a user for a number. Determine if the number is even or odd.

## Problem 11

Write Python code that asks a user for three numbers. Print the number that is the greatest. Print the number that is the least.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.pythonclassroom.com/decisions-if-elif-else/if-elif/if-else-problems.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
