Implement the following questions using Python. Make use of conditional and print statements. Make sure to clearly define your variables and don’t forget to indent your code.
Note: Solutions without indentation will be awarded no marks.
The logician Raymond Smulyan describes an island containing two types of people:
knights who always tell the truth and knaves who always lie. You visit the island and are approached by two natives who speak to you as follows:
• A says: B is a knight.
• B says: A and I are of opposite type.
What are A and B?
Hint: You are required to solve 4 puzzles from this problem statement. Think!
Comments
Leave a comment