> 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/nested-if/nested-if-problems.md).

# nested if Problems

## Problem 1

Write Python code that asks the user if they are filing what status they are filing as. The choices are:

* Single
* Married Filing Jointly
* Head of Household

Ask the user what their income was. Subtract the appropriate deduction.  Note: Married Filing Separately has the same standard deduction as single.&#x20;

Print the amount of tax due.

![Source: Kiplinger](/files/-LrfcoGJDvV5ZLtA8ts6)

![Source: Kiplinger](/files/-LrfcDpsR26MJ4LzYhOT)

![Source: Kiplinger](/files/-LrfcLr7EjBlMxgYzsso)

## Problem 2

These rates apply to the Lincoln & Holland tunnels, the George Washington, Bayonne & Goethals bridges, and the Outerbridge Crossing.

Write Python code to determine the amount of money you pay at the toll depending on:

* Vehicle Type
* The number of axels
* EZPass Off Peak Hours
* EZPass Peak Hours
* EZPass
* Cash

Peak Hours

* Weekdays: 6-10 a.m., 4-8 p.m.
* Sat. & Sun.: 11 a.m.-9 p.m.

Off-Peak Hours

* All Other Times

Overnight Hours for Trucks

* Sundays-Thursdays, 10 p.m. until 6 a.m. the following morning

![Source: The Port Authority of New York and New Jersey](/files/-Lx_iOLVjJO5qCwxPdSd)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
