This is my code. I want to return str1 and after 20-30 seconds return str2. I know i cant tipe two times return str1 and below it str2. how can i set timer to it so it returns, i tried like this but dont have ideas any more.
import os
import sys
import time
from weather import *
greeting=(["Change", "change", "CHANGE"]) question_1=(["stop",
"STOP"])
str1 = """Hey [First Name]!
Are your ready for a free overview of my favorite ways to find new
income opportunities?
This is going to CHANGE the way you look at your options!
It’s kinda weird, but Facebook requires that I confirm you really want
it…so please reply and type CHANGE"""
str2 = """ Hey [First Name]! Thanks for subscribing! As promised here
is your requested link https://thebusinessofnursing.com/earn-more-now
P.S. If you ever want to unsubscribe, just type “stop”."""
def classify(msg):
msg=msg.strip()
if(msg in greeting):
return str1
def classify2(msg):
time.sleep(5)
return str2
if __name__ == '__main__':
while(1):
msg=raw_input("Write Something: ")
print(classify(msg), classify2(msg))