Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions basics/01_introduction/03_ASCII_art_banner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from art import *

# Generate ASCII art for the text "PYTHON"
# text2art() converts the string into a stylized ASCII banner
ascii_banner = text2art("PYTHON")

# Print the generated ASCII art to the console
print(ascii_banner)
30 changes: 30 additions & 0 deletions basics/01_introduction/04_mad_libs_story_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
""" This program generates a fun story by asking the user for different types of words"""

def mad_libs_story():
# Ask the user for words
name = input("Enter a name: ")
animal = input("Enter an animal: ")
adjective1 = input("Enter an adjective: ")
adjective2 = input("Enter another adjective: ")
place = input("Enter a place: ")
verb1 = input("Enter a verb (present tense): ")
verb2 = input("Enter another verb (present tense): ")
food = input("Enter a type of food: ")
color = input("Enter a color: ")

# Story template with placeholders
story = f"""
Once upon a time, in the {adjective1} land of {place}, there lived a {adjective2} {animal} named {name}.
Every morning, {name} would {verb1} happily around the {color} fields, dreaming of {food}.
One day, {name} decided to {verb2} beyond the mountains to discover new adventures.
Along the way, {name} met many strange creatures, some friendly and some {adjective1}.
Finally, after a long journey, {name} returned home with amazing stories to share, feeling proud and {adjective2}.
And from that day on, {name} became known as the bravest {animal} in all of {place}.
"""

# Print the story
print(story)

# Run the story generator
if __name__ == "__main__":
mad_libs_story()
Loading