Deprecated: Return type of WPCF7_FormTag::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/form-tag.php on line 396
Deprecated: Return type of WPCF7_FormTag::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/form-tag.php on line 388
Deprecated: Return type of WPCF7_FormTag::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/form-tag.php on line 382
Deprecated: Return type of WPCF7_FormTag::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/form-tag.php on line 400
Deprecated: Return type of WPCF7_Validation::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/validation.php on line 78
Deprecated: Return type of WPCF7_Validation::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/validation.php on line 72
Deprecated: Return type of WPCF7_Validation::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/validation.php on line 59
Deprecated: Return type of WPCF7_Validation::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/cscircles/dev/www/wordpress/wp-content/plugins/contact-form-7/includes/validation.php on line 82 15B: Python push ups | Computer Science Circles
[Beginner Python Coding Classes]
15B: Python push ups
Oefeningen 15A, 15B, en 15C kunnen in elke willekeurige volgorde worden doorgewerkt.
In deze les komen verschillende middelgrote programma's aan bod waarmee de tools in eerdere lessen gecombineerd aan de orde komen.
In de volgende opdracht moet je de methode string.split() gebruiken. Deze methode verwijdert de spaties uit een string, en levert een lijst met de losse woorden op. Gebruik ook string.lower() om kleine letters te maken van alle letters in een string. Bijvoorbeeld:
"Splits deze woorden!".split() levert de lijst ["Splits", "deze", "woorden!"] op
"KleIneLeTTeRs".lower() heeft als resultaat: "kleineletters"
Let op: split() accepteert nog meer opties om strings op andere manieren te splitsen; zie de documentatie.
Stel dat je n smaken schepijs hebt, en je wil een sorbet maken met precies k verschillende smaken. Hoeveel combinaties zijn er dan mogelijk? Bijvoorbeeld, stel dat n=4 en k=2, dan zijn er 6 mogelijkheden:
(1) A en B, (2) A en C, (3) A en D, (4) B en C, (5) B en D, (6) C en D.
(de smaken zouden hier bijvoorbeeld Aabrikoos, Bosbessen, Chocolade, en Druif kunnen zijn).
Je kunt op een vergelijkbare manier 2 mensen kiezen uit een groep van 4 (Albert, Bob, Carola, David) om een commissie te vormen. Op hoeveel manieren kan de commissie worden samengesteld? Ook nu is het antwoord 6. De volgende opdracht gaat over het uitrekenen van dit aantal.
In de wiskunde wordt het getal dat je net hebt berekend meestal geschreven als
en uitgesproken als "n boven k." Deze waarden hebben allerlei interessante eigenschappen, zoals
en
Dit is het einde van deze opgaveserie; je kunt nu door naar een andere les.