[Tutor] python dictionaries

2007-01-05 Thread Raven Of Night Raven Of Night
Hi, there was this two step program I was working on but i can only complete 
the first step.

- - Write a Who's Your Daddy? program that lets the user enter the name of 
the male and produces the name of his father. Allow the user to add, 
replace, and delete father son pairs. The program should also allow the user 
to get a list of all son, fathers, or father son pairs.

I made a dictionary:
family = { "Wane Wilright" : "Dan Wilright",
   "Michal Zheng" : "Tsu Zheng",
   "Art Core" : "Vandalee Core",
   "John Wane" : "Calvin Wane" }

and was able to complete the rest of the program.


Then I was asked to improve the program:
- - Improve the Who's Your Daddy program by adding a choice that lets the 
user enter a name and get back a grandfather. Your program should still use 
one dictionary of son-father pairs. Make sure to include several generatios 
in your dictionary so that a match can be found.

I don't understand, dictionarys only allow two elements so how can you 
include several generations in the dictinoary... could you perhaps put a 
dictinoary inside a dictionary? I don't understand how you would do the 
second part.

_
The MSN Entertainment Guide to Golden Globes is here.  Get all the scoop. 
http://tv.msn.com/tv/globes2007/?icid=nctagline2

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] hi, learning python

2006-12-24 Thread Raven Of Night Raven Of Night

print "Guesses you've taken: ",i, "\nGuess letter: "
letter_guess = raw_input()'


this is a line of my program, and raw_input only takes one argument. I want 
it to display like this

Guesses you've taken: 0
Guess letter: (letter would go here)

instead of

Guesses you've taken: 0
Guess letter:
(leter you've taken)

is there a way to continue the input line, like in java you would just do 
System.out.print?

thanks

_
Experience the magic of the holidays. Talk to Santa on Messenger. 
http://clk.atdmt.com/MSN/go/msnnkwme008001msn/direct/01/?href=http://imagine-windowslive.com/minisites/santabot/default.aspx?locale=en-us

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor