# Prerequisite Exam: How to ignore (inf)inite values

**URL:** <https://get-help.theconstruct.ai/t/prerequisite-exam-how-to-ignore-inf-inite-values/3689>\
**Category:** ROS Prerequisites Exam\
**Tags:** quiz\
**Created:** [May 20, 2020, 3:51pm UTC](https://get-help.theconstruct.ai/t/prerequisite-exam-how-to-ignore-inf-inite-values/3689 "2020-05-20T15:51:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![laura.firth](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/laura.firth/32/10_2.png) [@laura.firth](https://get-help.theconstruct.ai/u/laura.firth)\
**Post date:** [May 20, 2020, 3:51pm UTC](https://get-help.theconstruct.ai/t/prerequisite-exam-how-to-ignore-inf-inite-values/3689/1 "2020-05-20T15:51:37Z")

</div>

Hi,

I’ve spent quite a lot of time doing the prerequisites exam on my free account and recently upgraded to a paid account through my work place.

Would it be possible to provide answers for the prerequisite exam to see where I have went wrong and how I could improve?

Thanks,

Laura

---

<div class="post-metadata">

**Author:** ![laura.firth](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/laura.firth/32/10_2.png) [@laura.firth](https://get-help.theconstruct.ai/u/laura.firth)\
**Post date:** [May 26, 2020, 9:38am UTC](https://get-help.theconstruct.ai/t/prerequisite-exam-how-to-ignore-inf-inite-values/3689/2 "2020-05-26T09:38:48Z")

</div>

The main thing I couldn’t seem to achieve was to ignore inf and find the highest position in Task 1 of the Python Exam?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ralves](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/ralves/32/7039_2.png) [@ralves](https://get-help.theconstruct.ai/u/ralves)\
**Post date:** [May 29, 2020, 12:53pm UTC](https://get-help.theconstruct.ai/t/prerequisite-exam-how-to-ignore-inf-inite-values/3689/3 "2020-05-29T12:53:33Z")

</div>

Hi @laura.firth,

Welcome to our community.

In order to ignore the `inf` values, you can just check whether the value you are checking is `inf` or not.

In this link you will find an example on how to achieve that:

> [@How to exclude "inf(inite)" values when checking laser values?](https://get-help.robotigniteacademy.com/t/how-to-exclude-inf-inite-values-when-checking-laser-values/1762/5):
>
> Hi @dave.m.mckay, A good way of ignoring laser values with infinite is checking whether the laser value is inf. In your code below: distance = float(laser) if biggest \< distance: biggest = distance this could be achieved with (note and distance != inf): inf = float('inf') … distance = float(laser) if biggest \< distance and distance != inf: biggest = distance This should solve the problem. Please let us know in case you have more questions.

Please let us know in case you need further assistance.
