0% found this document useful (0 votes)
15 views13 pages

PWP Final Project 2

Python

Uploaded by

vaijantachavle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views13 pages

PWP Final Project 2

Python

Uploaded by

vaijantachavle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Index

Sr. No. Contents Page No.

Annexure I– Micro Project Proposal 2-4

1.Aims/Benefits of the Micro-Project 2

2. Course Outcome Addressed 2

1 3.Proposed Methodology 2

4. Action Plan 3

5. Resources Required 4

6. Name of student with roll no 4

Annexure II – Micro Project Report 5-113

1.Rationale 5

2.Aims/Benefits of the Micro-Project 5

3.Course Outcome Achieve 5

4. Literature Review 5-6

2 5.Actual Methodology Followed 6-7

6. Actual Resources Used 7

7. Source Code 8-11

8. Output 11-12

9. Skill developed out of this Micro-Project: 13

10. Applications of this Micro-Project 13

1
Annexure I
Micro Project Proposal
Mad lib python generator game

1. Aims/Benefits of the Micro-Project:

Mad libs generator is a fun game that is usually played by kids. In this python game user has
to enter substitutes for blanks in the story without knowing the story. It will be fun to read aloud
the stories after filling the blanks.

2. Course Outcome Addressed:


a. Display message on screem using Python script on IDE.
b. Develop Python program to demonstrate use of Operators.
c. Perform operations on data structures in python.
d. Develop fuctions for given problem.
e. Design classes for given problems.
f. Handle exceptions.

3. Proposed Methodology:

The objective of this project is to develop a Mad Libs Generator python project. In this project,
the user first has to pick a story by the title of the story. Then the user has to enter specific words
like a noun, adverb, verb, food, adjective, etc, according to the requirements. And then the story
will be generated.

This is a python project for absolute beginners and is developed using the basic concept of
python and tkinter.

Remember the days when multiple players were required to play the Mad Libs in the
parties/school. Well, that time is gone; because parties have become obsolete in this COVID-19
era, so we bring to you an easy-to-code, single-player, virtual mad libs generator gamethat you
can play alone. Get a list of words to substitute for blanks in a story before reading aloud, have
fun and learn about Tkinter library as well.

2
4. Action Plan:

Sr. Details of Activity Planned Planned Name of Responsible


No. Start date Finish date Team Members
Collecting business 06/01/2024 13/01/2024
1
requirement 1:00 – 3:00 PM 1:00 – 3:00 PM

20/01/2024 27/01/2024
2

Kalyani Sakshi
Shivanand

5. Resources Required:

Sr.No. Name of resource / material Specification Quantity Remarks


WINDOWS 10, 8GB
1 Computer RAM, 256 GB SSD 1

2 Operating System WINDOWS 10 1

3 Browser Chrome 1

4 Development tool Python, PyCharm 1

3
6. Names of Team Member with Roll No.:

Sr. No. Enrollment No. Name of Team Member Roll No.

1 2110950053 Sakshi Shivanand Kalyani 04

Mr. Chavan A.Y.


Name and Signature of the Teacher

4
Annexure – II
Micro-Project Report
Mad lib python generator game

1. Rationale:
Python is a powerful programming language.It has efficient high-level data structure and a
simple but effective approach to object-oriented programming.Python code is
simple,short,readable,intiutive,and powerful,and thus is effective for introducing and computing
and problem solving to beginners.It‟s eligant syntax and dynamic typing together with it‟s
interpreted nature,make it an ideal language for scripting and rapid application development in
many areas on most platforms.
2. Aims/Benefits of the Micro-Project:
Mad libs generator is a fun game that is usually played by kids. In this python game user has
to enter substitutes for blanks in the story without knowing the story. It will be fun to read aloud
the stories after filling the blanks.

3. Course Outcomes Achieved:


a. Display message on screem using Python script on IDE.
b. Develop Python program to demonstrate use of Operators.
c. Perform operations on data structures in python.
d. Develop fuctions for given problem.
e. Design classes for given problems.
f. Handle exceptions.

4. Literature Review:

Mad Libs was invented in 1953 by Leonard Stern and Roger Price. Stern and Price created the
game, but could not agree on a name for their invention. No name was chosen until five years
later (1958), when Stern and Price were eating Eggs Benedict at a restaurant in New York City.
While eating, the two overheard an argument at a neighboring table between a talent agent and
an actor. According to Price and Stern, during the overheard argument, the actor said that he
wanted to "ad-lib" an upcoming interview. The agent, who clearly disagreed with the actor's
suggestion, retorted that ad-libbing an interview would be "mad". Stern and Price used
that eavesdropped conversation to create, at length, the name "Mad Libs".In 1958, the duo

5
released the first book of Mad Libs, which resembled the earlier
games of consequences and exquisite corpse.
Stern was head writer and comedy director for The Steve Allen Show, and suggested to the
show's host that guests be introduced using Mad Libs completed by the audience. Four days after
an episode introduced "our guest NOUN, Bob Hope", bookstores sold out of Mad Libs books.
Stern and Price next partnered with Larry Sloan, a high school friend who was working as
a publicist at the time, to continue publishing Mad Libs. Together, the three founded the
publishing firm Price Stern Sloan in the early 1960s as a way to release Mad Libs. In addition to
releasing more than 70 editions of Mad Libs under Sloan, the company also published 150
softcover books, including such notable titles as How to Be a Jewish Mother, first released in
1964; Droodles, which was also created by Roger Price; The VIP Desk Diary; and the
series World's Worst Jokes.
Price died in 1990, and three years later, Sloan and Stern sold Price Stern Sloan, including Mad
Libs, to the former Putnam Berkley Group, which is now known as Penguin Random
House. Mad Libs books are still published by Penguin Random House; however, all references to
Price Stern Sloan have been removed from the company's official website. Stern died at age 88
on June 7, 2011, and Sloan on October 14, 2012.
More than 110 million copies of Mad Libs have been sold since the game series was first
published in 1958.

5. Actual Methodology Followed:

MAD LIBS is one of the world‟s fun word games. Some would even call it one of the

„GREATEST WORD GAME”. If you enjoy playing around with words, then you probably agree

with this phrase.

MadLibs is a phrasal template word game where one player prompts others for a list of words to

substitute for blanks in a story/poem/rhyme before reading aloud. The game is frequently played

as a party game or as a pastime.

It is a game where there are neither losers or winners. A game that fills the room with laughter
and creates such a relaxing environment, something every one of us needs from time to time for a
healthy mental state.

6
In this article, I am going to share a simple way of creating this game in Python. As a beginner or

expert developer, we do need that little fun. Even if you have no coding experience at the moment
while reading this article, you will be able to grasp a few concepts and a basic understanding

of Python Programming.

HOW IT IS PLAYED

Most often, the game has a simple sequence around it, the aim might be to form a simple

poem/rhyme such as the one below, or a short story, just for fun.
“Roses are red, Violets are Blue, Sugar is sweet and So are you”.

6. Actual Resources Used:

Sr. Name of resource /


Specification Quantity Remarks
No. material

WINDOWS 10, 8GB


1 Computer 1
RAM, 256 GB SSD
2 Operating System WINDOWS 10 1

3 Browser Chrome 1

4 Development Tool Python,PyCharm 1

5 Software Python 3.9 1

7
DFD OF MAD LIB GENERATOR

7. Source Code:
#import module
from tkinter import *
8
# initialize window
root = Tk()
root.geometry('300x300')
root.title('DataFlair-Mad Libs Generator')
Label(root, text= 'Mad Libs Generator \n Have Fun!' , font = 'arial 20 bold').pack()
Label(root, text = 'Click Any One :', font = 'arial 15 bold').place(x=40, y=80)

################Stories##############

def madlib1():

animals= input('enter a animal name : ')


profession = input('enter a profession name: ')
cloth = input('enter a piece of cloth name: ')
things = input('enter a thing name: ')
name= input('enter a name: ')
place = input('enter a place name: ')
verb = input('enter a verb in ing form: ')
food = input('food name: ')
print('say ' + food + ', the photographer said as the camera flashed! ' + name + ' and I had gone
to ' + place +' to get our photos taken today. The first photo we really wanted was a picture of us
dressed as ' + animals + ' pretending to be a ' + profession + ' .when we saw the second photo, it
was exactly what I wanted. We both looked like ' + things + ' wearing ' + cloth + ' and ' + verb + '
--exactly what I had in mind')

def madlib2():

adjactive = input('enter adjective : ')

9
color = input('enter a color name : ')
thing = input('enter a thing name :')
place = input('enter a place name : ')
person= input('enter a person name : ')
adjactive1 = input('enter a adjactive : ')
insect= input('enter a insect name : ')
food = input('enter a food name : ')
verb = input('enter a verb name : ')

print('Last night I dreamed I was a ' +adjactive+ ' butterfly with ' + color+ ' splocthes that
looked like '+thing+ ' .I flew to ' + place+ ' with my bestfriend and '+person+ ' who was a
'+adjactive1+ ' ' +insect +' .We ate some ' +food+ ' when we got there and then decided to
'+verb+ ' and the dream ended when I said-- lets ' +verb+ '.')

def madlib3():
person = input('enter person name: ')
color = input('enter color : ')
foods = input('enter food name : ')
adjective = input('enter aa adjective name: ')
thing = input('enter a thing name : ')
place = input('enter place : ')
verb = input('enter verb : ')
adverb = input('enter adverb : ')
food = input('enter food name: ')
things = input('enter a thing name : ')

print('Today we picked apple from '+person+ "'s Orchard. I had no idea there were so many
different varieties of apples. I ate " +color+ ' apples straight off the tree that tested like '+foods+ '.

10
Then there was a '+adjective+ ' apple that looked like a ' + thing + '.When our bag were full, we
went on a free hay ride to '+place+ ' and back. It ended at a hay pile where we got to ' +verb+ ' '
+adverb+ '. I can hardly wait to get home and cook with the apples. We are going to make appple
'+food+ ' and '+things+' pies!.')

######buttons
Button(root, text= 'The Photographer', font ='arial 15', command= madlib1, bg ="ghost
white").place(x=60, y=120)
Button(root, text= 'apple and apple', font ='arial 15', command = madlib3, bg ="ghost
white").place(x=70, y=180)
Button(root, text= 'The Butterfly', font ='arial 15', command = madlib2, bg ="ghost
white").place(x=80, y=240)
root.mainloop()

8. Output:

11
12
9. Skill developed / Learning out of this Micro-Project:
From this project, we came to know about how a mad lib python game is built using PyCharm. In
the objective of doing so, you got to know the features of the mad lab as it is very intresting game,
its flow, and the requirements to build it. Further, we saw the things we need to know to get started
with the development of the mad lib game. Finally, we saw the actual implementation of the mad
lib python genenerator along with its source code.

10. Applications of this Micro-Project:


1. Mad libs generator is a fun game that is usually played by kids.
2. In this python game user has to enter substitutes for blanks in the story without knowing the
story.
3. It will be fun to read aloud the stories after filling the blanks.

*****

13

You might also like