EXERCISE TOPIC▼
- Access exercises (91)
- C# exercises (79)
- Excel exercises (278)
- Power Apps exercises (13)
- Power Automate exercises (18)
- Power BI exercises (139)
- Power Platform exercises ()
- Python exercises (28)
- Report Builder exercises (141)
- SQL exercises (198)
- SSAS exercises (51)
- SSIS exercises (46)
- SSRS exercises (99)
- VBA exercises (85)
- Visual Basic exercises (46)
PYTHON EXERCISES▼
PYTHON EXERCISES▼
Python | Sequences exercise | Print a list of integers not expressible in a certain way
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
Software ==> | Python (28 exercises) |
Version ==> | Latest version |
Topic ==> | Sequences (7 exercises) |
Level ==> | Harder than average |
Subject ==> | Python training |
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Let's define an owl number as an integer which can be expressed as the sum of at least one integer and the sum of its digits. For example, the number 371 generates an owl number of 382, since:
- the value of 371 is 371
- the sum of its digits is 3 + 7 + 1 = 11
- the sum of 371 and 11 = 382
Using this information, generate a list of the integers between 1 and 10000 which are not owl numbers:

The start of your output should look like this (group your numbers into 100s).
One way to do this is to generate a list of owl numbers, then loop over the integers finding all those not in this list.
When you've finished, close your file down!