Skip to content

Commit aa96f69

Browse files
committed
madlibs added.
1 parent 4e0da75 commit aa96f69

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

001 - MadLib/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
# 001 MadLib with Python
2+
3+
![Static Badge](https://img.shields.io/badge/python-exercises-blue?logo=python)
4+
![Static Badge](https://img.shields.io/badge/IDE-VsCode-blue)
5+
6+
![Visitor Count](https://profile-counter.glitch.me/{storlak}/count.svg)
7+
8+
🌟 This short code includes 2 madlibs written in Python:
9+
10+
- About Me: Gathers information about you and prints it.
11+
- Startrek short story: a short story to be completed by user.

001 - MadLib/madlib-aboutme.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# madlib aboutme
2+
3+
while True:
4+
yourname = input("What is your name: ").capitalize()
5+
country = input("Where are you from?: ").capitalize()
6+
city = input("Where do you live?: ").capitalize()
7+
age = input("How old are you?: ")
8+
mariagestatus = input("What is your marriage status?: ")
9+
if (
10+
yourname.isdigit()
11+
or country.isdigit()
12+
or city.isdigit()
13+
or not age.isdigit()
14+
or mariagestatus.isdigit()
15+
):
16+
print("Enter valid value")
17+
else:
18+
age = int(age)
19+
break
20+
21+
madlib = f"Hello! My name is {yourname}. I am from {country} and I live in {city}."
22+
madlibe2 = f"I am {age} years old and {mariagestatus}."
23+
print(madlib)
24+
print(madlibe2)

001 - MadLib/madlib-startrek.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# madlib about startrek
2+
3+
noun1 = input("Enter a noun about space: ")
4+
crewmember1 = input("Enter a crew memberfrom Star Trek: ")
5+
adj1 = input("Enter an adjective about a ship in Star Trek: ")
6+
noun2 = input("Enter a noun about Journey: ")
7+
madlib = f"In the depths of space, the USS Enterprise encounters a spatial {noun1}. Using advanced mathematics, {crewmember1} calculates a {adj1} trajectory to navigate the ship safely through the anomaly, saving the crew from certain disaster. Their journey through the {noun2} continues, fueled by the power of logic and mathematics."
8+
9+
print(madlib)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A collection of mini Python projects and scripts developed during the learning process. This repository showcases a variety of small-scale projects such as mad libs, digital clocks, URL shorteners, and other examples that demonstrate fundamental concepts and techniques in Python programming. These projects are designed to provide hands-on experience with Python and help reinforce programming skills.
66

7-
## Content
7+
## 🚀 Content
88

99
1. [Madlib](/001%20-%20MadLib/)
1010
2.

0 commit comments

Comments
 (0)