create a rap song using 5 words using the command input in python

Here's an example of a Python program that prompts the user to enter 5 words, and then generates a rap song using those words:

main.py
# Prompt the user to enter 5 words
word1 = input("Enter the first word: ")
word2 = input("Enter the second word: ")
word3 = input("Enter the third word: ")
word4 = input("Enter the fourth word: ")
word5 = input("Enter the fifth word: ")

# Generate the rap song using the input words
print("Yo, listen up, I got something to say")
print(f"I'm spittin' rhymes that'll blow you away")
print(f"{word1}, {word2}, {word3}, {word4}, {word5}")
print("These are the words that I'm gonna use")
print("To show the world how I can groove")
print("My flow is sick, my rhymes are tight")
print("I'm the king of the mic, and I'll prove it tonight")
635 chars
16 lines

When you run this program, it will prompt the user to enter 5 words. Then, it will generate a rap song using those words, as shown in this example output:

main.py
Enter the first word: fresh
Enter the second word: fly
Enter the third word: dope
Enter the fourth word: beats
Enter the fifth word: rhymes

Yo, listen up, I got something to say
I'm spittin' rhymes that'll blow you away
fresh, fly, dope, beats, rhymes
These are the words that I'm gonna use
To show the world how I can groove
My flow is sick, my rhymes are tight
I'm the king of the mic, and I'll prove it tonight
415 chars
14 lines

related categories

gistlibby LogSnag