Re: Replace blanks with letter

2013-08-22 Thread eschneider92
I wanted the program to stop only after all the letters were typed; why in the world would I try to write a program with blanks for each letter that seem intended to be filled, only to have it stop if the last letter is typed, or have to type each letter so many times until its processed? If

Re: Replace blanks with letter

2013-08-22 Thread eschneider92
I wanted the program to stop only after all the letters were typed; why in the world would I try to write a program with blanks for each letter that seem intended to be filled, only to have it stop if the last letter is typed, or have to type each letter so many times until its processed? If

Re: Replace blanks with letter

2013-08-21 Thread eschneider92
Thanks. I am running into a bunch of problems with the following code, all of which are clear when running the program import random letters='abcdefg' blanks='_'*len(letters) print('type letters from a to g') print(blanks) for i in range(len(letters)): if letters[i] in input():

Replace blanks with letter

2013-08-20 Thread eschneider92
I'm trying to replace the blank(_) with the letter typed in by the user, in the appropriate blank(_) spot where the letter should be (where is in the letters list). letters='abcdefg' blanks='_ '*len(letters) print('type letter from a to g') print(blanks) input1=input() for i in

Re: Replace blanks with letter

2013-08-20 Thread eschneider92
Is there also a way to have the code remember what I typed and not stop after the first letter the user types? For example, if I typed 'a' once, thus returning 'a__', and then typed in 'b', I want the code to return 'ab_' and so on. I wasn't clear about this part in my original post.

.split() Qeustion

2013-08-13 Thread eschneider92
How can I use the '.split()' method (am I right in calling it a method?) without instead of writing each comma between words in the pie list in the following code? Also, is there a way to use .split instead of typing the apostrophes? Thank you. import random pie=['keylime', 'peach', 'apple',

Re: .split() Qeustion

2013-08-13 Thread eschneider92
It's obvious that the word 'without' in my first sentence was meant to be ommited, and it's a simple question. Thank Gary! -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
This is what I ended up with btw. Does this insult anyone's more well attuned Python sensibilities? letters='abcdefghijkl' def repeat(): print('wanna go again?') batman=input() if batman in ('y','yes'): main() else: return def main(): print('guess a letter')

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
This is what I ended up with btw. Does this insult anyone's more well-attuned Pythonic sensibilities? letters='abcdefghijkl' def repeat(): print('wanna go again?') batman=input() if batman in ('y','yes'): main() else: return def main(): print('guess

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
I don't understand any of the advice any of you have given. -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
Thanks, though me not utilizing any of the other advice wasn't from lack of trying; I couldn't understand any of it. I get it now that I have a corrrect example code in front of me. -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
What does global mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
(I forgot to post this with my last post.) Also, I don't understand any part of the following example, so there's no specific line that's confusing me. Thanks for the help btw. var = 42 def myfunc(): var = 90 print before:, var myfunc() print after:, var def myfunc(): global

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
(I forgot to post this with my last post.) Also, I don't understand any part of the following example, so there's no specific line that's confusing me. Thanks for the help btw. var = 42 def myfunc(): var = 90 print before:, var myfunc() print after:, var def myfunc(): global

Re: beginner question (True False help)

2013-08-09 Thread eschneider92
I'm sorry, but I still don't understand how it applies to my problem. Thanks for everyone's patience. -- http://mail.python.org/mailman/listinfo/python-list

beginner question (True False help)

2013-08-07 Thread eschneider92
I'm trying to create an option for the program to repeat if the user types 'y' or 'yes', using true and false values, or otherwise end the program. If anyone could explain to me how to get this code working, I'd appreciate it. letters='abcdefghijklmn' batman=True def thingy(): print('type

Re: beginner question (True False help)

2013-08-07 Thread eschneider92
What I wanted to happen is when the user typed something other than 'y' or 'yes' after being asked 'go again?', the batman==False line would cause the program to stop asking anything and say 'this is the end'. Instead, what is happening is that the program just keeps going. I figured that after

Beginner question

2013-08-06 Thread eschneider92
Why won't the 'goodbye' part of this code work right? it prints 'ok' no matter what is typed. Much thanks. def thing(): print('go again?') goagain=input() if goagain=='y' or 'yes': print('ok') elif goagain!='y' or 'yes': print('goodbye') sys.exit() thing()

Re: Beginner question

2013-08-06 Thread eschneider92
Thanks that helped a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Hangman question

2013-08-05 Thread eschneider92
Thanks I get it now. -- http://mail.python.org/mailman/listinfo/python-list

Hangman question

2013-08-04 Thread eschneider92
I'm on chapter 9 of this guide to python: http://inventwithpython.com/chapter9.html but I don't quite understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional information and help would be greatly

Print word from list

2013-08-03 Thread eschneider92
pie='apple keylime pecan meat pot cherry' pie.split() How can I print a word from the list other than this way: print(pie[0:5]) ? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Print word from list

2013-08-03 Thread eschneider92
Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple program question.

2013-06-11 Thread eschneider92
No. -- http://mail.python.org/mailman/listinfo/python-list

Simple program question.

2013-06-09 Thread eschneider92
How do I make it so I only have to type in 'parry' once? import random words=['hemisses', 'hestabsyou'] randomizer=random.choice(words) if input()!=('duck', 'parry'): print('try again') if input()=='duck': print(randomizer) if randomizer=='hemisses': results=['you should have

Re: Beginner question

2013-06-05 Thread eschneider92
Thanks everyone! -- http://mail.python.org/mailman/listinfo/python-list

Beginner question

2013-06-03 Thread eschneider92
Is there a more efficient way of doing this? Any help is gratly appreciated. import random def partdeux(): print('''A man lunges at you with a knife! Do you DUCK or PARRY?''') option1=('duck') option2=('parry') optionsindex=[option1, option2]

repeat program

2013-04-29 Thread eschneider92
How do I make the following program repeat twice instead of asking whether the player wants to play again? import random import time def intro(): print('You spot 2 caves in the distance.') print ('You near 2 cave entrances..') time.sleep(1) print('You proceed even nearer...')

Guess the Number Repeat

2013-04-25 Thread eschneider92
How do I make the following program play the 'guess the number game' twice? import random guessesTaken = 0 print('Hello! What is your name?') myName = input() number = random.randint(1, 20) print('Well, ' + myName + ', I am thinking of a number between 1 and 20.') while guessesTaken 6:

Re: guessthenumber print games left

2013-04-11 Thread eschneider92
How do I make it say that I have one game left? I'm having trouble fitting it into my main code. Thanks a lot for the help btw. -- http://mail.python.org/mailman/listinfo/python-list

Re: guessthenumber print games left

2013-04-11 Thread eschneider92
The 2 makes the game play twice instead of 3 times, right? I've tried it with the 1, but but I'm still having trouble. Again, to be exact, I want to somehow make it count down from 2 (the number of games)and print. If that's what this does, is it possible to insert it into my original main

Re: guessthenumber print games left

2013-04-11 Thread eschneider92
If you get the time, please post an example, because I don't understand. -- http://mail.python.org/mailman/listinfo/python-list

guessthenumber print games left

2013-04-10 Thread eschneider92
Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess the number, I want it to tell me that i get one more game. P.S. I'm totally new to python (obviously), and I just added numberofgames variable

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote: On Wed, Apr 10, 2013 at 7:39 PM, eschneide...@comcast.net wrote: Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
On Wednesday, April 10, 2013 5:39:23 AM UTC-4, eschne...@comcast.net wrote: Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess the number, I want it to tell me that i get one more game. P.S.

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
(Didn't mean to post the last bit.) Is this possibly what you meant? If it is I still can't figure out how to apply it to the guessthenumber program. numberofgames=1 while numberofgames4: numberofgames=numberofgames+2 print (4-numberofgames) if numberofguesses3: