-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFake-news-generator.py
More file actions
46 lines (32 loc) · 1.21 KB
/
Copy pathFake-news-generator.py
File metadata and controls
46 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import random
import pyttsx3
engine = pyttsx3.init()
names = ["Narendra Modi","Amit Shah","Rahul Gandhi","Virat Kohli",
"Rohit Sharma","MS Dhoni","Shah Rukh Khan","Akshay Kumar",
"Mukesh Ambani","Ratan Tata","ISRO Scientists"]
actions = ["launching a scheme","addressing a rally","meeting diplomats",
"reviewing security","participating in a Yatra","criticizing policies",
"meeting students","training","practicing","breaking a record",
"shooting a scene","testing rockets","donating","investing"]
locations = ["New Delhi","Mumbai","Bengaluru","Hyderabad","Chennai",
"Kolkata","Jaipur","Goa","Ahmedabad","Varanasi","Kerala","IIT Delhi",
"Sriharikota","Film City Mumbai"]
def speak(t):
try:
engine.say(t)
engine.runAndWait()
except:
print("voice problem")
while True:
n = random.choice(names)
a = random.choice(actions)
l = random.choice(locations)
news = "BREAKING NEWS: " + n + " " + a + " in " + l + " !!"
print()
print(news)
speak(news)
again = input("More news? (Y/N): ")
if again.lower() != "y":
break
print("Thanks for using this news generator")
speak("Thanks for using this news generator")