11-05-2009, 04:21 PM
Hey guys I just started to learn about python and I wanted to make a code that replies an answer to a prelisted question so what should it look like?
Good and Bad you Decide.
Help needed
|
11-05-2009, 04:21 PM
Hey guys I just started to learn about python and I wanted to make a code that replies an answer to a prelisted question so what should it look like?
Good and Bad you Decide.
11-05-2009, 04:37 PM
I guess the reply is on some website.
So you should look about the urllib2 module.
11-05-2009, 06:59 PM
No I want to make a simple py code that when asked a predefined question will answer back with a predefined phrase.
Good and Bad you Decide.
There are better ways of doing this but I'm a bit n0ob myself, but it does the job!
Code: #! usr/bin/env python questionList is a list/array where you store your questions, questionId is used in the loop to get the right answer for the question. print answer[questionId][0] would output "I'm a snake.." if the user types "What are you" I've made this so it can be used with random function to output random answer for a specific question.
11-05-2009, 07:50 PM
(This post was last modified: 11-05-2009, 07:51 PM by Kenji Harima.)
Thanks dude very appreciated. I'll ask you if I need any more help.
Good and Bad you Decide.
|
« Next Oldest | Next Newest »
|