Day 3 of #100DaysOfCode: Missing - A Detective's Mystery

In Day 3 of #100DaysOfCode, I have created a short mini project called Missing: A Detective's Mystery program using the following concepts I learnt today from Dr Angela Yu's 100DaysOfCode: The Complete Python Bootcamp course:

  • If Statements

  • Multiple If Statements in succession

  • Nested If and Elif statements

  • Logical Operators

In the Missing: A Detective Mystery program, you are prompted to input the person that is missing during the an incident that happened. Afterwards, detective Fetchard prompts you to provide the location of the incident that took place. Next, detective Fetchard starts searching every part of that location to see if any clues can be found. If the clue is found, it asks for a name of the person who could potentially be a suspect otherwise the investigation ends inconclusively due to lack of evidence. The name is provided and starts interrogating the suspect by asking the following questions:

  • During the time person went missing, were you in a location where you can provide proof or witnesses to confirm your whereabouts? (yes or no)

  • What were you specifically doing around the time person disappeared? (Provide details)?

  • Have you had any previous incidents and altercations between yourself and person (yes or no)?

Based on the responses that detective Fetchard receives on those questions, it determines whether they meet certain conditions to be considered a suspect. If insufficient evidence is provided by the suspect which doesn't indicate or relate to the cause of the missing person then it concludes without identifying a suspect.

Python Concepts used

IF statements

IF statement is used in the program because Detective Fetchard can find out whether there was any clues during the investigation at the location where the person was missing. This was a huge decision for Detective Fetchard to make because either there was clues during their investigation or it ends due to lack of evidence.

Multiple IF Statements in succession

In this program, if the clue was found during the investigation by Detective Fetchard, the program proceeds into another decision making process as to whether they were are able to identify the potential suspects of this incident. If they did find a potential suspect, he enters the name of the suspect and proceeds to interviewing the suspect.

Nested IF and elif statements

After the interview process with the suspect, Nested if and elif statements are used to analyse the responses given by the suspect. Multiple responses related to alibi, activities and previous history that are connected to past incidents with the missing person to determine if the suspect is involved or not.

Logical Operators

To help further improve and determine whether the suspect is involved or not, it uses logical operators like and and or within the if and elif statements. A good example of that used in this program is utilising two conditions. The 1st condition is if the suspect confirmed that they had an alibi. The 2nd condition is that they were not involved in previous incidents with the missing person. With those conditions in mind, it uses an and operator. This operator asks the program that if the suspect does have an alibi and they were not involved in previous incidents with the person that went missing, it determines that they are most likely involved in which caused the person to go missing.

In conclusion, this mini project did take me a bit longer than expected because I did face a few syntax issues and was finding a way to integrate all of the python concepts that I learnt from Day 3 of #100DaysOfCode. For the full code this mini project, please visit my GitHub repository - https://github.com/keiransystem14/Python100daysofcode/tree/main/Day%203%20Project%20-%20Missing%3A%20A%20Detective's%20Mystrey