[PYTHON] Programmer 8th grade [Even or Odd (even or odd)] Can you solve this programming problem? !!

[[Codewars] A site where you can train from the basics of coding in a browser (Vim can be used in a browser and supports 32 programming languages. More than 4000 problems have been posted!)](Https://qiita.com/ I introduced the Codewars site in the article javacommons / items / 7c473cda7825ab99e08c), but since it is an English site, I think that there are many people who say "I can't read the problem", so it's simple (correct answer rate). I would like to present the "Japanese translation of the question sentence" in order from the problem (most). The problem this time is a small check.

You can solve the problem without signing up for Codewars, so if you read the above article and understand how to operate it, click "URL:" below to go directly to the problem page. Please jump. Click the "TRAIN" button to open the IDE (answer) screen.

** Codewars is a code creation / debugging / test (provided by the problem creator) on the browser (even if you do not have a development environment on your machine). The feature is that you can execute the above and submit the answer when you get the approval that the answer is correct. (So, it's safe with Rakuchin. Also, CodinGame is the same.) In addition, there is no penalty even if an error occurs in the test execution including this test (unless it is because it is easier to develop in your own environment), so execute the cancer cancer test on Codewars (in the browser). Please try it. ** **

If you have any questions, please comment. Also, if you can SUBMIT safely, please paste (post) your proud answer (source code) in the comment section. You can use any programming language that the problem supports.

Problem name: Even or Odd URL: https://www.codewars.com/kata/even-or-odd

** * Each Codewars problem corresponds to one of 32 programming languages. The supported languages differ for each problem. ** **

image.png

Well, this is the problem statement.

image.png

[Japanese translation of the above question sentence]


Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers.
Takes an integer as an argument, for even numbers"Even"For odd numbers"Odd"Create a function that returns.

Please also refer to the sample test (data)

image.png

[Sample test]


Test.assertEquals(even_or_odd(2), "Even")
Test.assertEquals(even_or_odd(0), "Even")
Test.assertEquals(even_or_odd(7), "Odd")
Test.assertEquals(even_or_odd(1), "Odd")

This issue is a small check, so it's probably too easy!

Well then! w Look forward to the next time! !! ww

A project to translate problem sentences into Japanese! !! w (Problems will become more and more challenging!)

Recommended Posts

Programmer 8th grade [Even or Odd (even or odd)] Can you solve this programming problem? !!
Even or odd
Can you solve sports scheduling?