Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def robot_wait():
- input("press enter to continue..")
- def robot_chat():
- print("Hi, my name is Sarvesh")
- print("What's your name?")
- first_name = input("Enter your name: ")
- print("how are you feeling today")
- print((first_name) + ("?"))
- happiness = input("How are you feeling today? : ")
- print("oh ok")
- reasoning = input("why? : ")
- print("Ok, let's change the topic")
- print("What do you want to talk about?")
- topic = input("What do you want to talk about? : ")
- print(("what do you know about the ") + (topic) + ("?"))
- fact = input(("what do you know about ") + (topic) +("? : "))
- print(fact)
- print("oh that's a interesting fact.")
- myname = "Sarvesh"
- fsubject = input("What's your favourite subject in school? :")
- msubject = "Math"
- print(("oh, your favourite subject in school is ") + (fsubject) + (", my favourite subject in school is ") + (msubject))
- print("ok, I gotta go now")
- print(("Bye ") + (first_name))
- robot_wait()
- def robo_speech():
- from gtts import gTTS
- import os
- from datetime import datetime
- import time
- spech = input("What do you want me to say?")
- tts = gTTS(text=spech, lang='en')
- tts.save("good.mp3")
- print("please wait.. loading")
- time.sleep(10)
- # Fibonacci series
- def robot_fib():
- n = input("Enter a number: ")
- a = 0
- b = 1
- fibnum = [0,1]
- count = 2
- while count < int(n):
- c = (a + b)
- count += 1
- fibnum.insert(count,c)
- a = b
- b = c
- j = 0
- for num in fibnum:
- j += 1
- print(str(j), "-> ", num)
- robot_wait()
- def robot_dice():
- import random
- print(random.randint(1,6))
- import os
- e = input("Do you want to roll again.. press 'Y' to continue: ")
- os.system('clear')
- if (e =='Y') or (e == 'y'):
- robot_dice()
- def chat():
- print("Welcome to Chat Room \n")
- robot_chat()
- def speech():
- print("Welcome to Robo Talk \n")
- robo_speech()
- robot_wait()
- def fibonaccinums():
- print("Welcome to Fibonacci Series Center \n")
- robot_fib()
- def dice():
- print("Welcome to Dice Table \n")
- robot_dice()
- def guide():
- print("Help Page: \n")
- print("1. In Chat, you can chat with a robot")
- print("2. In Speech, you enter a saying and then a robot says it")
- print("3.In Fibonnacci Numbers, you can find out numbers of fibonnacci")
- print("4.In Dice, you can generate a random number between 1 through 6")
- robot_wait()
- def exit():
- import os
- e = input("Are you sure you want to exit.. press 'Y' to exit: ")
- os.system('clear')
- if (e =='Y') or (e == 'y'):
- ("Good Bye.. exiting Robo meet., see you again")
- quit()
- def printOptions():
- print("Welcome to Robot Sarvesh...\n")
- print("1. Chat")
- print("2. Speech")
- print("3. Fibonacci Numbers")
- print("4. Dice")
- print("5. Help")
- print("6. Exit")
- def robot_main():
- import os
- os.system('clear')
- printOptions()
- argument = input ("Enter your option: ")
- os.system('clear')
- if (argument == "1"):
- chat()
- elif (argument == "2"):
- speech()
- elif (argument == "3"):
- fibonaccinums()
- elif (argument == "4"):
- dice()
- elif (argument == "5"):
- guide()
- elif (argument == "6"):
- exit()
- while(1):
- robot_main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement