Python for Kids Book: Project 8
September 6, 2015 1 Comment
In these posts I outline the contents of each project in my book Python For Kids For Dummies. If you have questions or comments about the project listed in the title post them here. Any improvements will also be listed here.
What’s in Project 8 (Silly Sentences)
Project 8 is a short project which teaches you about (old style) formatting strings. Formatting strings allow you to create a sentence template into which you can substitute words. Four words are chosen from four lists (at random) and substituted into a sentence. The random matchings make nonsense sentences. The substitutions can be streamlined by using a data type called the tuple, so that data type is introduced and discussed. You learn how to unpack tuples and how to use a tuple to receive multiple values from a function. The project also relies on the random.choice method.