Treasure Island - Python Project

 Day- 3


Welcome to the Day-3 Project of 100 days of Python.

In this project we will see different types of -

  1. Conditional Statements
  2. If-else
  3. Nested If

Before getting into Coding we will see, What are the requirements and what we havt to do?

Findings : 

  • Which Direction the user want to move?
  • How to Proceed for further steps?
  • You can set the Conditions as per your Design
  • Set a Win/Lose Condition
Here, I'll show you a Glimpse of Code how I designed. Make Sure you try out in your Ways...

Let's get started with the Code :

   


print("Welcome to the TREASURE ISLAND !! \n Mission is to Find the TREASURE, Islander ")

step1 = input("On What direction you want to make a move ? Left(L) / Right(R)")
if(step1 == "L".lower()):
    task = input("Do you want to Swim or Wait ?")
    if(task == "Wait".lower()):
        door = input("On which Door you want to Wait ? \n Red \n Blue \n Yellow")
        if(door == "Yellow".lower()):
            print("Hooray ! Islander you Win")
        else:
            print("You are killed by a Shark !! GAME OVER")
    else:
        print("You are killed by a Lion !! GAME OVER")
else:
    print("You falled in a Pit !! GAME OVER")

Post a Comment

Previous Post Next Post