On Thu, Jan 5, 2012 at 9:22 AM, daedae11 <daeda...@126.com> wrote: > ** > The exercise is: > > Write a function which has 3 parameters. First parameter is a char, second > parameter is a integer, third parameter is a integer. > The function would create a file which have following requests: > 1. the length of the file is in accordance with the third parameter. > 2. the content of the file must be random generated. > 3. the time first parameter occurred in the content must be in accordance > with second parameter. > > please give me some hints. It would be better if you give me the code. >
It would be better if /you/ gave us the code that shows what you've tried. Also, if we give you the solution(s) then you won't learn. To accomplish this exercise you need a few skills: 1. Write a function that takes parameters - can you do this? 2. Create a file - can you do this? 3. Generate random text - can you do this? 4. Modify text (or generate slightly less-random text) - can you do this? If you can do those four things then you should be able to easily accomplish this task (that looks an awful lot like homework) HTH, Wayne
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor