User Profile

Collapse

Profile Sidebar

Collapse
FlamingoRider
FlamingoRider
Last Activity: Feb 25 '09, 04:01 AM
Joined: Feb 18 '09
Location: Washington
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • FlamingoRider
    replied to If statement trouble
    I ended up putting the while statement in there but now whenever they type something other than Y or N it ends up looping the print statement under the else:.

    I thought putting a return afterwards would solve it but that just causes the program to move to the next function.

    Any suggestions?

    Current code:

    Code:
    toDo = []
    
    import time
    import os
    import random
    
    def
    ...
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    started a topic If statement trouble

    If statement trouble

    I wrote a short program that stores user input into a list, asks if there's anything else that needs to be entered, and eventually selects an item out of the list.

    The problem I have is that if the user puts anything other than y or n when asked if there is anything else, it'll exit out of the if block and continue. Is there any way that I can make it loop back without using a while statement?

    Code:
    toDo =
    ...
    See more | Go to post

  • FlamingoRider
    replied to Program freezes
    Well that did it! It works perfectly now lol. Thanks so much for all the help. I didn't know about the xrange function, I'll have to look that up. And putting [i] after myFears, I wouldn't have thought about it. I have a lot more reading to do I guess :(
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    replied to Program freezes
    O.K. I've been trying at this for awihle now and I think I'm about to lose it lol.

    I can't figure a way to properly loop fearList() so the LEV sequence will work. I also can't get the DEL sequence to work. The only thing that looks like it works correctly is adding new fears.

    Any insight will be of great relief.

    Code:
    myFears = []
    def firstFear():
        print "You have not entered
    ...
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    replied to multiplying indeces
    Just made an empty list and wrote a function to mulitply and put the answer into the list.

    Code:
    L = [1,2,3]
    L2 = [2,3,4]
    multList = []
    
    def multInde():
        multList.append(L[0]*L2[0])
        multList.append(L[1]*L2[1])
        multList.append(L[2]*L2[2])
    
    multInde()
    print multList
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    started a topic Program freezes

    Program freezes

    When my program enters the fearList() function it will sit at a blank line and I'm unable to enter anything.

    Code:
    myFears=[]
    def firstFear():
        if len(myFears) < 1:
            print "You have not entered any fears yet. Please enter one now."
            fear=raw_input("What is a fear of yours?")
            myFears.append(fear)
            return
    
    def fearList():
    ...
    See more | Go to post

  • FlamingoRider
    replied to Invalid Syntax
    Wow, that was easy. Thanks a lot. I feel kinda stupid for not catching that myself. Got the bugs out now just gotta tinker with it to get it working the way I need. Thanks for all the help.
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    started a topic Invalid Syntax

    Invalid Syntax

    I keep getting a syntax error on line 11 (while Running = True:) and I'm not sure what's going on. If this is something horribly simple I apologize. I appreciate any help.

    Code:
    myFears=" "
    def addFear():
        if len(myFears) < 1:
            print "You have not entered any fears yet. Please enter one now."
            fear=raw_input("What is a fear of yours?")
            myFears.append(fear)
    ...
    See more | Go to post

  • FlamingoRider
    replied to Getting a memory address
    Well, that was quite simple, I feel kinda stupid for not figuring it out myself. Thank you very much.
    See more | Go to post

    Leave a comment:


  • FlamingoRider
    started a topic Getting a memory address

    Getting a memory address

    Hello. I know that this is probably going to be a really simple question but this is my first program that I'm trying to write in any program and I'm stumped. It's very short:

    Code:
    counter = 0
    
    def letterSwitch1():
        while counter <= number:
            print "A" * number
            print "B" * number
            counter = counter + 1
            return
    
    number=raw_input("Enter
    ...
    See more | Go to post
    Last edited by FlamingoRider; Feb 18 '09, 08:57 AM.
No activity results to display
Show More
Working...