Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f99f3a9

Browse files
Merge pull request #1 from Faris-A-Nasir/Faris-A-Nasir-patch-1
Create text.py
2 parents bd3c3a2 + 2fdbc74 commit f99f3a9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎text.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import random
2+
3+
# Define lists of words and phrases to use in the generator
4+
nouns = ["cat", "dog", "house", "car", "book"]
5+
verbs = ["runs", "jumps", "sleeps", "eats", "reads"]
6+
adjectives = ["happy", "fast", "green", "loud", "big"]
7+
adverbs = ["quickly", "loudly", "slowly", "gently", "suddenly"]
8+
9+
def generate_random_text():
10+
sentence = f"{random.choice(nouns)} {random.choice(verbs)} {random.choice(adverbs)} {random.choice(adjectives)}."
11+
return sentence
12+
13+
# Generate and print random text
14+
for _ in range(5):
15+
random_text = generate_random_text()
16+
print(random_text)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /