Re: [Tutor] software modeling tools used with Python
Thanks, Alan. The whole situation is clear as day now. Alexander Kapshuk ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] software modeling tools used with Python
Thanks a lot Danny. Will definitely look into those things. Regards, Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] software modeling tools used with Python
Thanks for your reply, Alan. I'm not there yet, as in I'm not a very experienced Python programmer and I'm still in the early stages of learning the language and programming as a whole. What I'm looking for is a way to design my programs, big or small, other than just pseudo-coding them on a piece of paper. How do you design your programs? Regards, Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] software modeling tools used with Python
Dear Python Community, I was just wondering about what software modelling tools are normally used to design Python programs. I have heard of Star UML. Has anyone used it to design their programs? What else is available out there? Thanking you all in advance. Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] IDLE running fine now under Windows 95:-)
IDLE in Python 2.2.3 working fine on my laptop now. I'd like to give Python 2.5.1 one more try though:-). Looks like it didn't 'seem' to run not because there was something wrong with the laptop or Windows as such, but because of the USER not being patient enough. It's an old beaten up thing that requires a certain amount of patience on the part of the user. I was able to run it successfully for the first time by accessing it directly from Python22\Tools\Idle\idle.py and then the 2nd time by clicking on the IDLE icon on my desktop. So, sorry for causing much ado about nothing:-). Thank you all once again. Regards, Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] problems with running IDLE under Windows 95
Hello to All of the Python Community, I'd like to thank all those who replied to my last email about Python not installing under Windows 95. That problem's been overcome. Although, after installing Python 2.5.1 I ran into another difficulty. IDLE wouldn't start. Another thing I did was uninstall Python 2.5.1 and install Python 2.2.3 to see if it would make any difference. It didn't. I'd click on the IDLE icon, the hourglass thing would come up for a few seconds and then it would disappear. What could the problem be there? Thanking you in advance and looking forward to hearing from those of you who may have an answer. Regards, Alexander Kapshuk ISD Education Office ICQ#295-121-606 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] can python run under windows 95?
Hello Everyone, Quick question ... I've got an old Toshiba Satellite 110CT laptop with Windows 95 installed on it. It's got 40 MB of RAM and a 3 GB hard drive. Would I be able to run Python on it? If so, what version of Python should I install? I've tried installing Python 2.5 on it, but got a message saying that the installation file could not be unpacked. What could the problem be? Thanking you all in advance and looking forward to hearing from you, Alexander Kapshuk. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] 'word jumble' game
Hello Everyone, This is Alexander Kapshuk writing here again ... Could you please have a look at the code below and let me know of any shortcuts that could be used there. The code works fine as it is. I was just wandering if there was a better, more compact and elegant way of writing the program. Thanking you all in advance. Alexander Kapshuk # Word Jumble Game # # The computer picks a random word and then "jumbles" it. # The player has to guess the original word. # # Should the player be stuck and require a hint, they will be prompted for a hint. # If the player answers 'yes', the appropriate hint will be displayed and the player will be asked to guess again. # If the player answers 'no', they will be asked to guess again and awarded some points if they manage to guess the jumbled word without ever asking for a hint. import random # create a sequence of words to choose from WORDS = ("python", "jumble", "easy", "difficult", "answer", "xylophone") # pick one word randomly from the sequence word = random.choice(WORDS) # create a variable to use later to see if the guess is correct correct = word # create hints for all the jumbled words hint0 = "\nIt's the best programming language for the absolute beginner ...\n" hint1 = "\nIt's what this program does to words to make it difficult to guess them ...\n" hint2 = "\nIt's not difficult ...\n" hint3 = "\nIt's not easy ...\n" hint4 = "\nIt's not a question ...\n" hint5 = "\nIt's a musical instrument you have to hit with 2 small sticks ...\n" # create a jumbled version of the word jumble = "" while word: position = random.randrange(len(word)) jumble += word[position] word = word[:position] + word[(position + 1):] # start the game print \ """ Welcome to Word Jumple! Unscramble the letters to make a word. (Press the enter key at the prompt to quit.) """ print "The jumble:", jumble guess = raw_input("\nYour guess: ") guess = guess.lower() score = 0 while (guess != correct) and (guess != ""): print "\nSorry, that's not it.\n" hint_prompt = raw_input("Would you like a hint? Y/N: ") hint_prompt = hint_prompt.lower() if hint_prompt == "yes" and correct == WORDS[0]: print hint0 elif hint_prompt == "yes" and correct == WORDS[1]: print hint1 elif hint_prompt == "yes" and correct == WORDS[2]: print hint2 elif hint_prompt == "yes" and correct == WORDS[3]: print hint3 elif hint_prompt == "yes" and correct == WORDS[4]: print hint4 elif hint_prompt == "yes" and correct == WORDS[5]: print hint5 elif hint_prompt == "no": score += 50 guess = raw_input("Your guess: ") guess = guess.lower() if guess == correct and hint_prompt == "no": print "\nThat's it! You guessed it!\n" print "Because you never asked for a hint you get", score, "points.\n" print "\nThanks for playing." raw_input("\n\nPress the enter key to exit.") ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] guess my number game
I'm working on a program that has the user think of a number between 1 and 100 and then tries to guess that number. I'm having trouble telling the computer to keep on looking for the correct number, each time narrowing down the search range. Please see the code below. import random print "\tWelcome to 'Guess My Number 1.2'!" print "\nThink of a number between 1 and 100." print "The computer will try to guess it in as few attempts as possible.\n" # set the initial values user_number = int(raw_input("Think of a number between 1 and 100 and press Enter: ")) guess = random.randrange(50) + 1 answer = "" tries = 1 # guessing loop print guess answer = raw_input("Is the above No '>', '<' or '=' as your No?: ") while (answer != "="): if (answer == ">"): print (guess = random.randrange(100) + 51) elif (answer == "<"): print (guess = random.randrange(49) + 1) elif (answer == "="): print "Correct! The number was", user_number "And it only took you", tries " tries!\n" else: print "Keep on trying!" tries += 1 raw_input("\n\nPress the enter key to exit.") Thanking you all in advance. Alexander Kapshuk ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] breaking the 'while' loop
Dear All, I have been learning computer programming with Python only for a short while. I have a question to do with breaking the while loop. I have attached the source code of a program called 'Guess my number' with the while loop running until the right number is guessed. I want to limit the number of tries to 5. To do that, I have tried the if structure along with the break statement immediately below the 'tries += 1' line: if tries > 5: break print "Wrong guess!" Which still did not result in the while loop breaking after attempt No 5. I would appreciate being explained what I am doing wrong. Regards, Alexander Kapshuk guess_my_number.py Description: guess_my_number.py ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] python query
Dear All, My name is Alexander Kapshuk. I'm interested in learning to program in Python. I have very little programming experience. I've learnt some basics of programming with Logo. I've downloaded Python 2.5 for Windows XP Professional. I would appreciate any advice on what to do next. What books/tutorials to use? I understand that learning a programming language involves practice. So, I suppose, I could use a book/tutorial with loads of practical code samples to try out. Any other practical advice you may deem feasible would be welcome. Thanking you in advance. Alexander Kapshuk. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor