# Error Bug in Prerequisites Exam , with Solution to fix it

**URL:** <https://get-help.theconstruct.ai/t/error-bug-in-prerequisites-exam-with-solution-to-fix-it/21510>\
**Category:** Site Feedback\
**Tags:** error\
**Created:** [January 9, 2023, 2:00pm UTC](https://get-help.theconstruct.ai/t/error-bug-in-prerequisites-exam-with-solution-to-fix-it/21510 "2023-01-09T14:00:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nass2usa](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/nass2usa/32/4347_2.png) [@nass2usa](https://get-help.theconstruct.ai/u/nass2usa)\
**Post date:** [January 9, 2023, 2:00pm UTC](https://get-help.theconstruct.ai/t/error-bug-in-prerequisites-exam-with-solution-to-fix-it/21510/1 "2023-01-09T14:00:10Z")

</div>

Dear TheConstruct Team ,

Greeting ,

There is bug with Prerequisites Exam in file  
**robot\_control\_class.py**

The **Path** for the file :  
/home/simulations/public\_sim\_ws/src/all/ros\_basics\_examples/python\_course\_class/robot\_control\_class.py

The Error shown here and which is line 159 :

 ![Screenshot (52)](https://get-help.robotigniteacademy.com/uploads/default/original/2X/b/b22aecc1ee644250eb2697f434119ad47689e2d2.png)

The Output in Terminal showing This :

```auto
Current distance to wall: 3.320596
Current distance to wall: 2.573591
Current distance to wall: 1.831416
Current distance to wall: 1.075487
Traceback (most recent call last):
  File "task2.py", line 29, in <module>
    robotcontrol.turn(90, -1, 1.8)
  File "/home/simulations/public_sim_ws/src/all/ros_basics_examples/python_course_class/robot_control_class.py", line159, in turn
    s = "Turned robot " + clockwise + " for " + str(time) + " seconds"
TypeError: cannot concatenate 'str' and 'int' objects

```

This error is occurring because you are trying to concatenate a string and an integer using the `+` operator. You need to convert the integer value to a string using the `str()` function before you can concatenate it with the string.

Here is an example of how you can fix this error:

```auto
s = "Turned robot " + clockwise + " for " + str(time) + " seconds"

```

Alternatively, you can use string formatting to create the string:

```auto
s = "Turned robot {} for {} seconds".format(clockwise, time)

```

The Result Disappear the error , proof :

 ![Screenshot (53)](https://get-help.robotigniteacademy.com/uploads/default/original/2X/3/344a1dd90e9cd23ddfd00620e84eae262f8960cc.jpeg)

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [January 24, 2023, 11:07pm UTC](https://get-help.theconstruct.ai/t/error-bug-in-prerequisites-exam-with-solution-to-fix-it/21510/2 "2023-01-24T23:07:07Z")

</div>


