Skip to content

platformps/GLAB-370.1.2-The-Great-If-Else-Adventure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

GLAB-370.1.2-The-Great-If-Else-Adventure

Introduction

Welcome to the GLAB-370.1.2! In this lab, you will embark on an exciting adventure into the world of if-else statements in Python. Get ready to unravel the mysteries of decision-making as you explore the depths of conditional logic. But don't worry, we'll make it fun along the way!

Prerequisites

To fully enjoy this lab, you should have a basic understanding of Python syntax

Instructions

Step 1: Enter the Land of If-Else

As you step into this peculiar land, you'll encounter an if-else statement like no other. Brace yourself and prepare to be amazed. Here's a simple example to get you started:

# The Enchanted Door
password = input("Enter the secret password: ")

if password == "Open Sesame":
    print("The door opens wide. Welcome!")
else:
    print("The door remains closed. Access denied!")

Step 2: Run the Magical Code

To witness the power of this mystical if-else statement, follow these steps:

  • Open your favorite Python IDE or a text editor.
  • Create a new Python file and save it with a whimsical name like "if_else_adventure.py".
  • Copy the code snippet from Step 1 into your file.
  • Save the file and run it.

Step 3: Take a Leap of Faith

Now it's your turn to dive into the enchanting realm of if-else statements. Unleash your creativity and write your own code snippets using if-else statements. Need some inspiration? Here are a few ideas to get you started:

  • The Potion Conundrum: Write a program that asks the user for their age. If they are under 18, display a message saying they can't drink the magic potion. Otherwise, grant them access to the secret potion recipe.

  • The Riddle of the Sphinx: Create a riddle game where the user has to guess the correct answer. If they guess right, congratulate them on their wisdom. Otherwise, bewilder them with a clever hint.

  • The Tricky Troll: Imagine a troll guarding a bridge. Prompt the user to answer a riddle. If they answer correctly, they may pass unharmed. Otherwise, well... let's just say they'll have a bumpy journey.

Remember, the sky's the limit! Feel free to come up with your own if-else adventures. Get creative, be playful, and have fun!

Step 4: Share Your Quest

Once you've completed your if-else adventures, share your magical creations with your instructor.

Conclusion

Congratulations on completing The Great If-Else Adventure! You've mastered the art of decision-making through if-else statements and discovered the fun side of programming. Take these newfound skills and continue your journey into the vast realms of Python programming. The magical world awaits your exploration!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published