Skip to content
Permalink
Browse files
Create respondToIntro_1
  • Loading branch information
dahilj committed Oct 25, 2017
1 parent 7fffdb8 commit 65f3c62f799f9fda76ac1d4c484276a47426544b
Showing 1 changed file with 55 additions and 0 deletions.
@@ -0,0 +1,55 @@
#responding from a sentence on an introduction + choosing other (joke, funfact, etc)
import random

userInput = input("Hello, Human. Can you Introduce yourself? \n")

userWords = userInput.split()

words = ["My","my","name","is","I","am","Hello,","hello,","hey,","Hey,","hi,","Hi,"] #Single out the name

userName = ""
for i in range(len(userWords)): #iterate throught the user's words
foundWord = False #sets True when there's a similar word in the other list
for word in range(len(words)): #iterates and compares the chosen word from the user's list of words to the words list
if userWords[i] == words[word] and foundWord == False:
foundWord = True
if foundWord == False:
userName = userName + userWords[i] + " "

print("Hello, " + str(userName) + "... Nice to meet you!")

#picking out a subject
randomStuff = ["Cherophobia is the fear of fun","A flock of crows is called a murder","A single cloud can weight more than 1 million pounds"]

userInput = input("Please, pick a subject: Maths, Physics, Biology, Chemistry or other: \n")

if userInput == "maths" or userInput == "Maths":
print("You have chosen: " + userInput)
print("##############################")

#Input question here XD
elif userInput == "Physics" or userInput == "physics":
print("You have chosen: " + userInput)
print("##############################")

#Input question here XD

elif userInput == "Biology" or userInput == "biology":
print("You have chosen: " + userInput)
print("##############################")

#Input question here XD

elif userInput == "Chemistry" or userInput == "chemistry":
print("You have chosen: " + userInput)
print("##############################")

#Input question here XD

elif userInput == "Other" or userInput == "other":
print("You have chosen: " + userInput)
print("##############################")
userInput = input("Want to hear something else XD \n")

if userInput == "Yes" or userInput == "yes":
print(random.choice(randomStuff))

0 comments on commit 65f3c62

Please sign in to comment.