jeudi 22 janvier 2015

Adding items in a list randomly 100 times in Python

Hey all I just started learning about programming and this is problem I need to solve but I just can't get it: Get your computer to produce its 100 first utterances. These utterances are sequences of 1, 2, 3, or 4 random syllables sampled from the list:


[“ba”,”bi”,”bu”,”ga”,”gi”,”gu”].


You have to write a program that prints 100 random utterances of this type. For each utterances you have to select a random length (of 1, 2,3 or 4 syllables) for each utterance, plus randomly sample the chosen number of syllables from the set above.





Aucun commentaire:

Enregistrer un commentaire