concept declarative in category python

appears as: declarative
Tiny Python Projects: Learn coding and testing with puzzles and games

This is an excerpt from Manning's book Tiny Python Projects: Learn coding and testing with puzzles and games.

One of the biggest differences between this solution and all the others is that we use regular expressions to describe what we are looking for. We didn’t have to write the code to identify the vowels. This is more along the lines of declarative programming. We declare what we want, and the computer does the grunt work!

In the final solution for chapter 8, we briefly touched on “regular expressions” (also called “regexes”--pronounced with a soft “g” like in “George”), which give us a declarative way to describe patterns of text. The material here may seem a bit of a reach, but I really want to help you dig into regexes to see what they can do.