-
Master Walrus Operator While Calculating Internet Quota
Hello, checkiomatesš±āš¤!
Read about Simon Willison's experience as a member of Python Software Foundaton, take a short quiz about walrus operator and meet google colab - cloud-based coding and collaborative environment!
š”TIP
On Easy difficulty, each of the few starting stations is dedicated to a distinct data type. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
šMISSION
Internet Plan by freeman_lex -
John managed to get a great internet plan for his cell phone. The plan allows John to use a quota of up to X megabytes of data per month to surf the Internet. If John doesn't use all of his quota in a month, the unused megabytes are added to the next month's quota. According to the contract, John can never use more megabytes than his current quota.
In this problem, you are given the value of the monthly quota X and the number of megabytes that John used in each of the first N months of the plan. Your task is to determine how many megabytes John has left to use in month N+1.
internet_quota(200, [150, 220]) == 230 internet_quota(100, [50, 80, 30]) == 240 internet_quota(150, [120]) == 180
šARTICLES
Things Iāve learned serving on the board of the Python Software Foundation -
Two years ago Simon Willison was elected to the board of directors for the Python Software Foundationāthe PSF. In this blog post he writes up some of the things heās learned along the way.
Google Colab: Your Ultimate Guide to Coding in the Cloud (With Examples) -
So youāve probably heard of Google Colab, the cool kid in the world of coding environments. But what exactly is Google Colab, and why is everyone so hyped about it? Think of it as your personal, cloud-based coding notebook where you can write, run, and share Python code like a pro, without even needing to install anything on your computer. Sounds magical, right? Well, it kind of is! In this article, Iāll walk you through the ins and outs of Google Colab, how to use it, and give you some practical examples to get you started. Letās dive in!
The Walrus Operator: Python's Assignment Expressions Quiz -
In this quiz, youāll test your understanding of the Python Walrus Operator. This operator, used for assignment expressions, was introduced in Python 3.8 and can be used to assign values to variables as part of an expression.
š©āš»CODE SHOT
How do you think, what the following code does?
def ??????(time): hour, minutes = map(int, time.split(':')) res= abs(30 * (hour % 12) - 5.5 * minutes) return min(res, 360 - res)
š Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ā¤µ
Welcome to CheckiO - games for coders where you can improve your codings skills.
The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.
Join the Game