vendredi 30 janvier 2015

[Answered]Python2 string input if-statement script

Below is the script I'm trying to write. I've made other working scripts, including simple if-statement scripts, but I wanted to experiment a bit and try making a script that relies on string inputs instead of integers or floaters.


It goes without saying that I'm still learning and won't require this to do my job, but thanks for trying if you decide to take a crack at it. I spent about an hour with another novice coder trying out tiny adjustments. I'm almost certain it's futile to have the input equal a string to start with, creating my strife.



answer = raw_input("Do you enjoy your work?\n")

print str(answer)
if answer = str("yes") :
print "I'm happy to hear that, " + str(name)"
print "I wonder what being a " + str(title) + " actually means."
print "I don't have the term in my vocabulary. I'm a machine."
raw_input("My script is over soon. Goodbye.\n")
else :
print "I'm sorry to hear that, " + str(name)"
print "I guess being a " + str(title) + " must be difficult."
raw_input("My script is over soon. Goodbye.\n")

Aucun commentaire:

Enregistrer un commentaire