Three Emerging Data Science Trends You Need to Know

Data science has become a necessity for companies looking for innovative and efficient ways of solving complex business problems. As the world becomes more data-centric, trends in data science…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Code Challenge I

This post will be the first in a series of posts about how I solved challenges from CodeWars. For each post, I will give the prompt, what the prompt entails, and how I solved each prompt.

Get the start number and the end number of a rage and return the count of all numbers except numbers with a 5 in it. The start and the end number are both inclusive!

2. How do I check to see if each integer contains 5? Well, Python cannot compare numbers like it can compare strings, so I decided to use a string comparison:

3. I decided that subtracting the number of fives from the total length would be the best way to find my answer. I had to create two variables: the length of the original list and the number of fives:

To pull the function together:

This challenge was simple, but was still fun to think about. I am aware that this function may not be super efficient, but I try to solve these challenges as quickly as I can.

Add a comment

Related posts:

A Guide to Choose an SEO Agency

If you are seeking for the steady growth of your company, you understand the specifications behind the concept of SEO. The primary step you have to take right now is to ensure that only the best team…

The Book That Introduced Me to Chris Lighty

I am going to start back writing about the books that I read throughout the year. I have read countless amounts of books this year but I will start from what I am currently reading at the moment…

How to tell if your eggs are actually expired and make them last even longer with this easy recipe

Little known fact about expiration dates: they aren’t an exact science. The easiest way to find out if your eggs have ACTUALLY gone bad is to get a large bowl and fill it ¾ of the way with water…