can someone help me please
#open file and read last names
filename = input('name file')
file = open(filename, 'r')
names_list = file.readlines()
file.close()
#open a file for saving passwords
outfile_name = input('Save passwords')
outfile = open(outfile_name, 'a')
#create a password for each n
I had a task in a book to pick 5 items from a list of 26 ensuring the items are
not repeated
import random
list = ['a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z']
word = ' '
a = random.choice(list)
list.remove(a)
b = random.choice
def ask_ok(prompt, retries=4, complaint="Yes or no, please!"):
while True:
password = input("enter something")
if password in ('y', 'ye', 'yes'): return True
if password in ('n', 'no', 'nope'): return False
retries = retries - 1
if retries < 0:
Hi
Just got the G1, is their any way to get python running on the andriod platform
?
--
http://mail.python.org/mailman/listinfo/python-list
hi,
Can someone help me i would like to run this program 3 times or more and would
like to append the cPickle file as a high score table keeping my top scores.
Right now it only records the last score thanks.
# Trivia Challenge
# Trivia game that reads a plain text file
def open_file(file_n
Hi
can someone tell me why it prints the high score table multiple times?
#high scores program
scores =[]
choice = None
while choice != 0:
print """high Score Table
0 - exit
1 - show Scores
2 - add a score
3 - delete a score
4 - sort scores
"""
has anyone completed python for the absolute beginner ?
chapter 7 in the book the trivia_challenge.py file does not work correctly and
does not display all the correct questions - and even though the answer is
correct it will still state the answer is wrong. this file is from the CD i
have not
stuck on python for absolute beginners
chapter 6
i actually done what i was supposed to do use the function ask_number for guess
a number
but for some reason it does not count correctly the number of tries
# Guess My Number
#
# The computer picks a random number between 1 and 100
# The player
Hi there. So I have a challenge in the Python book I am using (python
programming for the absolute beginner) that tells me to improve an ask_number()
function, so that it can be called with a step value, and I havn't
been able to find out yet what's meant by a step value, but i'll keep
looking of c
can someone explain why the tries displays the wrong number
thanks
orginally i started off with tries = 0 but it was off by 2
# Word Jumble
#
# The computer picks a random word
# The player has to guess the original word can give hint
import random
tries = 1
# create a sequence of words to
I would just like the program to exit after guessing the amount of numbers
wrong
# Guess My Number
import random
the_number = random.randrange(100) + 1
tries = 1
# guessing loop
while (guess != the_number):
if (guess > the_number):
print "Lower..."
else:
print "Higher..
11 matches
Mail list logo