need help for an assignment plz noob here

Rob Gaddi rgaddi at highlandtechnology.invalid
Mon Oct 17 18:52:16 EDT 2016


pedrorenato1998 at gmail.com wrote:

> Hello guys. so my assignment consists in creating a key generator so i can use it in later steps of my work. In my first step i have to write a function called key_generator that receives an argument, letters, that consists in a tuple of 25 caracters. The function returns a tuple of 5 tuples of caracters, each tuple with 5 elements.
>  Sounds confusing right? well I have the final product but i dont know how to get there. I was told by my professor that I dont really have to use any complicated knowledge of python so I have to keep it simple. Can u help me plz? just give me a hint how to do it and i'll do everything plz.
>
> example:
> Python Shell
>
>>>> letters = (‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, \
> ... ‘H’, ‘I’, ‘J’, ‘ ’, ‘L’, ‘M’, ‘N’, \
> ... ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, \
> ... ‘V’, ‘X’, ‘Z’, ‘.’)
>>>> key_generator(letters)
> ... ((‘A’, ‘B’, ‘C’, ‘D’, ‘E’),
> ... (‘F’, ‘G’, ‘H’, ‘I’, ‘J’),
> ... (‘ ’, ‘L’, ‘M’, ‘N’, ‘O’),
> ... (‘P’, ‘Q’, ‘R’, ‘S’, ‘T’),
> ... (‘U’, ‘V’, ‘X’, ‘Z’, ‘.’))

Start by playing with letters in the shell and seeing what you can do
with it.  The word you're looking for is 'slices'.  Figure out
interactively what you need to do, then write it up.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list