Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. from datetime import datetime
  2. import time
  3.  
  4. def bye():
  5. print("Ok, I gotta go now")
  6. print("It's been nice talking to you")
  7. print(("Bye ") + (first_name))
  8.  
  9. q = input("Do you think i'm programmed well? : ")
  10. if q.lower() == "no":
  11. print("Oh ok")
  12. hy = input("Why do you think i'm programmed bad?:")
  13. print("Oh, thank you for your feedback")
  14. else:
  15. print("Thank you")
  16.  
  17. print("Thanks for using Srobot")
  18. print("you can contact the creator at sarking.value@gmail.com")
  19.  
  20.  
  21.  
  22.  
  23. def robot_wait():
  24. input("press enter to continue..")
  25. def robo_speech():
  26. from gtts import gTTS
  27. import os
  28. from datetime import datetime
  29. import time
  30. spech = input("What do you want me to say?")
  31. tts = gTTS(text=spech, lang='en')
  32. tts.save("good.mp3")
  33. print("please wait.. loading")
  34. time.sleep(10)
  35. def robot_fib():
  36. n = input("Enter a number: ")
  37. a = 0
  38. b = 1
  39. fibnum = [0,1]
  40. count = 2
  41. while count < int(n):
  42. c = (a + b)
  43. count += 1
  44. fibnum.insert(count,c)
  45. a = b
  46. b = c
  47. j = 0
  48. for num in fibnum:
  49. j += 1
  50. print(str(j), "-> ", num)
  51. robot_wait()
  52. def robot_dice():
  53. import random
  54. print(random.randint(1,6))
  55. import os
  56. e = input("Do you want to roll again.. press 'Y' to continue: ")
  57. os.system('clear')
  58. if (e =='Y') or (e == 'y'):
  59. robot_dice()
  60. def chat():
  61. print("Welcome to Chat Room \n")
  62. robot_chat()
  63. def speech():
  64. print("Welcome to Robo Talk \n")
  65. robo_speech()
  66. robot_wait()
  67. def fibonaccinums():
  68. print("Welcome to Fibonacci Series Center \n")
  69. robot_fib()
  70. def dice():
  71. print("Welcome to Dice Table \n")
  72. robot_dice()
  73. def guide():
  74. print("Help Page: \n")
  75. print("1. In Speech, you enter a saying and then a robot says it")
  76. print("2.In Fibonnacci Numbers, you can find out numbers of fibonnacci")
  77. print("3.In Dice, you can generate a random number between 1 through 6")
  78. robot_wait()
  79. def exit():
  80. import os
  81. e = input("Are you sure you want to exit.. press 'Y' to exit: ")
  82. os.system('clear')
  83. if (e =='Y') or (e == 'y'):
  84. print("Good Bye.. exiting Robo meet., see you again")
  85. bye()
  86. quit()
  87. os.system("clear")
  88. def printOptions():
  89. print("Welcome to Robot Sarvesh...\n")
  90. print("1. Speech")
  91. print("2. Fibonacci Numbers")
  92. print("3. Dice")
  93. print("4. Help")
  94. print("5. Exit")
  95. def robot_main():
  96. import os
  97. os.system('clear')
  98. printOptions()
  99. argument = input("Enter your option: ")
  100. os.system('clear')
  101. if(argument == "1"):
  102. speech()
  103. elif(argument == "2"):
  104. fibonaccinums()
  105. elif(argument == "3"):
  106. dice()
  107. elif(argument == "4"):
  108. guide()
  109. elif(argument == "5"):
  110. exit()
  111. while(1):
  112. robot_main()
  113.  
  114.  
  115.  
  116. import os
  117.  
  118. os.system("clear")
  119. print("Hi, my name is Sarvesh")
  120. print("Nice to meet you")
  121. print("What's your name?")
  122. first_name = input("Enter your name: ")
  123.  
  124. a2345 = input("How old are you: ")
  125.  
  126. if a2345.lower() == "10":
  127. print("I'm 10 too")
  128. else:
  129. print("Oh your", a2345, ", I'm 10")
  130.  
  131. print("how are you feeling today")
  132. print((first_name) + ("?"))
  133.  
  134. happiness = input("How are you feeling today? : ")
  135.  
  136. print("oh ok")
  137.  
  138. reasoning = input("why? : ")
  139.  
  140. print("Ok, let's change the topic")
  141.  
  142. print("What do you want to talk about?")
  143.  
  144. topic = input("What do you want to talk about? : ")
  145.  
  146. if topic.lower() == "nothing":
  147. print("Oh ok")
  148. else:
  149. print(("what do you know about the ") + (topic) + ("?"))
  150. fact = input(("what do you know about ") + (topic) +("? : "))
  151. print(fact)
  152. print("oh that's a interesting fact.")
  153.  
  154. realcad = "yes"
  155. coad = input("Do you like to code? : ")
  156. if (coad.lower)() == realcad:
  157. print("Oh, I like to code too")
  158. print("I think coding is fun")
  159. else:
  160. print("Well, I like to code")
  161. print("I think coding is fun")
  162.  
  163. res = input("Do you think we should learn how to code? :")
  164.  
  165. if (res.lower)() == "yes":
  166. rea = ("Yeah me too, but why? :")
  167. print(rea)
  168. print("Ok")
  169. else:
  170. print("oh ok")
  171. rea1 = ("Why not? :")
  172. print(rea1)
  173.  
  174.  
  175.  
  176.  
  177. myname = "Sarvesh"
  178.  
  179. fsubject = input("What's your favourite subject in school? :")
  180. msubject = "Math"
  181.  
  182. if (fsubject.lower)() == msubject:
  183. print(("oh, your favourite subject in school is ") + (fsubject) + (", my favourite subject in school is ") + (msubject) + (" too."))
  184.  
  185. else:
  186. print(("oh, your favourite subject in school is ") + (fsubject) + (", my favourite subject in school is ") + (msubject))
  187.  
  188.  
  189. nnnn = input("Do you want to see my app? : ")
  190. if nnnn.lower() == "yes":
  191. robot_main()
  192.  
  193.  
  194. else:
  195. print("ok")
  196.  
  197.  
  198. print("Ok, I gotta go now")
  199. print("It's been nice talking to you")
  200. print(("Bye ") + (first_name))
  201.  
  202. q = input("Do you think i'm programmed well? : ")
  203. if q.lower() == "no":
  204. print("Oh ok")
  205. hy = input("Why do you think i'm programmed bad?:")
  206. print("Oh, thank you for your feedback")
  207. else:
  208. print("Thank you")
  209.  
  210. time.sleep(10)
  211. os.system("clear")
  212. print("Thanks for using Srobot")
  213. print("If you want to see more programs like this go to")
  214. print("sites.google.com/view/spythonprograms/home")
  215. print("you can contact the creator at sarking.value@gmail.com")
  216. time.sleep(5)
  217. os.system("clear")
  218. print("Exiting Srobot...")
  219. time.sleep(5)
  220. os.system("clear")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement