Checkio's recommendation for learning Python

Something to say

During this time, I tried Checkio, which I heard from my senior at work, and was addicted to it ~~ (it was interesting and the time melted near the deadline for my thesis) ~~, so I would like to introduce it.

What is Checkio

Learning about python and JavaScript while solving problems. If you answer the question correctly, you will be able to solve the next question, so you can proceed completely like a game. ~~ (This is the cause of melting time) ~~

Good points of Checkio

I think Progate is famous for learning python, but it costs money as the lesson progresses ... Of course, you can take good lessons as much as you spend, so I think it's natural to spend money.

However, I think it is human nature that nothing is better than free!

And because I wrote this, Checkio can be done for free!

Also, Checkio solves problems on the web, so I think one of the attractions is that you don't have to build a Python environment that you tend to get hooked on.

In addition, Checkio can post the code you write, get comments from those who see it, and see the code posted by others for the questions you answered correctly! I think it will be a good study just to see this!

Some difficult problems have hints, and you can solve them based on the hints, so it is recommended for those who are new to Python.

Checkio's next step

This is a completely personal opinion, but since the problem sentences are in English, I have a little trouble with that ... ~~ (It's a good story to study English) ~~ I am writing this article with a faint expectation that the Japanese version will be released if the number of Japanese people who read this starts and the population of Japanese people increases ...

How to get started with Checkio

Checkio From here, you can jump to the page and log in with your Github account, Facebook account, or Google account.

example

Some people may want to know what the problem is before logging in, so here's an example of what's actually happening in Checkio. If you put too many examples, you won't be able to enjoy it, so I'll just ask one question.

Problem Determine if the password is at least 10 characters long and contains all uppercase, lowercase and numbers.

def checkio(data):
#I will write the number of volumes that will be the answer in this part.
    if len(data) < 10:
    #Exclude those less than 10 in length
        return False
    elif data.isalpha():
    #Exclude all alphabets
        return False
    elif data.islower():
    #Exclude all lowercase ones
        return False
    elif data.isupper():
    #Exclude all capital letters
        return False
    elif data.isdigit():
    #Exclude all numbers
        return False
    else:
    #What's left is a good password
        return True
        
        

#Some hints
#Just check all conditions


if __name__ == '__main__':
    #These "asserts" using only for self-checking and not necessary for auto-testing
    assert checkio('A1213pokl') == False, "1st example"
    assert checkio('bAse730onE4') == True, "2nd example"
    assert checkio('asasasasasasasaas') == False, "3rd example"
    assert checkio('QWERTYqwerty') == False, "4th example"
    assert checkio('123456123456') == False, "5th example"
    assert checkio('QwErTy911poqqqq') == True, "6th example"
    print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")

The above is my answer. By the way, the code with the highest ranking among the posted codes is as follows

import re

DIGIT_RE = re.compile('\d')
UPPER_CASE_RE = re.compile('[A-Z]')
LOWER_CASE_RE = re.compile('[a-z]')

def checkio(data):
    """
    Return True if password strong and False if not
    
    A password is strong if it contains at least 10 symbols,
    and one digit, one upper case and one lower case letter.
    """
    if len(data) < 10:
        return False
    
    if not DIGIT_RE.search(data):
        return False

    if not UPPER_CASE_RE.search(data):
        return False

    if not LOWER_CASE_RE.search(data):
        return False
        
    return True

if __name__ == '__main__':
    assert checkio('A1213pokl')==False, 'First'
    assert checkio('bAse730onE4')==True, 'Second'
    assert checkio('asasasasasasasaas')==False, 'Third'
    assert checkio('QWERTYqwerty')==False, 'Fourth'
    assert checkio('123456123456')==False, 'Fifth'
    assert checkio('QwErTy911poqqqq')==True, 'Sixth'
    print('All ok')

You're using regular expressions. Certainly, it may be easier to understand what you are doing at a glance.

Well, I think it will be a learning experience to see the code written by other people like this.

Summary

So far, we have introduced Checkio. If you have any interest in it, please try it! ~~ (It's free so lol) ~~ If you feel like trying it out, please recommend it to others! Finally, I will post the link only once again. Checkio

Recommended Posts

Checkio's recommendation for learning Python
Learning flow for Python beginners
Python learning plan for AI learning
Web teaching materials for learning Python
<For beginners> python library <For machine learning>
2016-10-30 else for Python3> for:
python [for myself]
[Python] Learning Note 1
[Python machine learning] Recommendation of using Spyder for beginners (as of August 2020)
Python learning notes
python learning output
Why Python is chosen for machine learning
Python learning site
Python learning day 4
[Shakyo] Encounter with Python for machine learning
Python Deep Learning
[Python] Web application design for machine learning
Python learning (supplement)
An introduction to Python for machine learning
Python learning plan for AI learning Progress management
python learning notes
The story of low learning costs for Python
Upgrade the Azure Machine Learning SDK for Python
[Python] Collect images with Icrawler for machine learning [1000 images]
PDF files and sites useful for learning Python 3
[Implementation for learning] Implement Stratified Sampling in Python (1)
About Python for loops
Learning Python with ChemTHEATER 03
Python module (Python learning memo ④)
Reinforcement learning 1 Python installation
Python basics ② for statement
Learning Python with ChemTHEATER 05-1
Python: Deep Learning Practices
Python ~ Grammar speed learning ~
Reinforcement learning for tic-tac-toe
About Python, for ~ (range)
python textbook for beginners
Private Python learning procedure
Refactoring tools for Python
Learning Python with ChemTHEATER 02
Learning Python with ChemTHEATER 01
Python: Deep Learning Tuning
Python + Unity Reinforcement Learning (Learning)
Python: Supervised Learning (Regression)
Summary for learning RAPIDS
OpenCV for Python beginners
Install Python (for Windows)
Python: Supervised Learning (Classification)
[Python] for statement error
Python environment for projects
Image collection Python script for creating datasets for machine learning
Build an interactive environment for machine learning in Python
Python learning memo for machine learning by Chainer from Chapter 2
Python learning memo for machine learning by Chainer Chapters 1 and 2
Preparing to start "Python machine learning programming" (for macOS)
[Python] I made a classifier for irises [Machine learning]
Deep Learning Experienced in Python Chapter 2 (Materials for Journals)
Memo for building a machine learning environment using Python
Anaconda, site summary that was helpful for learning Python
Effective Python Learning Memorandum Day 15 [15/100]
Data set for machine learning