• # Could You Count Visible Discs Properly While Keeping Your Code Clean And Readable?

Hello, checkiomates๐ฑโ๐ค!

I welcome you in CheckiO weekly digest. Today we offer you an exercise about counting visible disks of different radius and an article about importance of clear code!

๐กTIP

If you find an interesting solution, you may add it to your bookmarks by clicking the flag near solution title. You can find all your bookmarked solutions by clicking your nickame and then "Bookmarks". If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

๐MISSION

Colorful Disks is a game played on a base with vertical stick and some paper disks with a hole in the center. The disks all have different radiuses and colors. When all the disks are stacked on top of each other, the number of colors that can be seen from above is the score in this game. So, disks that cannot be seen from above are not scored.

Given the radiuses of the disks in order of placing on the stick (from the bottom one to the top one), calculate the score when all the disks are stacked.

```count_discs((3, 6, 7, 4, 5, 1, 2)) == 3
count_discs((6, 5, 4, 3, 2, 1)) == 6
count_discs((5,)) == 1```

๐ARTICLE

Clear code is the cornerstone of efficient and maintainable software development. Its importance lies in its ability to be easily understood and modified by developers, leading to faster debugging, smoother collaboration, and reduced chances of errors. Clear code enhances readability, enabling programmers to grasp its logic swiftly and make necessary adjustments with confidence, fostering a sense of clarity and order within the codebase.

๐ฉโ๐ปCODE SHOT

How do you think, what the following code does?

```def ?????(num: int) -> int: return (9, num%9)[bool(num%9)|(not num)]
```