repl.it
@Fireballme/

mad_libs

Python

No description

fork
loading
Files
  • main.py
  • new.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import random 
name = input("What is your name? >>> ")
age = int(input("How old are you? >>> "))
adj = input("Adjective: ")
num = int(input("Whole number between 1 and 50: "))
pl_noun = input("Plural noun: ")
shelter = input("give a type of shelter. >>>")
animal = input("Animal: >>>")
taken = random.randrange(0,num)z
left = num - taken



#This is the new way we learned 
#It allows you to print string and numbers
print(f"Hello {name}, you are {age} years old.")
print(f"There are {num} {adj} {pl_noun} in the {shelter}") 
print(f"suddenly, an evil {animal} broke through the roof and took {taken} of the {pl_noun}!")
print("With only {left} of the {pl_noun} left, you went out to get revenge on thet {animal}.")
?