Python memo

Overview

At this study session, I was going to do some programming using Python.

Study content

The following 4 questions were challenged in this lecture

9×9 curtain Odds of Oddness Is. Below, I will describe the points that I personally felt different from java and C language when I actually solved these problems.

9×9 In this problem, I mainly solved the problem by dealing with numerical values in the input function. Python is different from the java and C languages you've learned so far a = 1 I thought that it is a very convenient point that the output becomes 1 just by inputting Also, use map (int, input (). Split ()) when entering multiple numbers in one line. curtain In this problem, if the difference between A and 2B is less than 0, the window will be completely covered. ʻIf [conditional expression]: [Processing when the conditional expression is true] else: [Processing when the condition is false] ` It was easy to solve using. The difference between the If statement and java or C language is that after entering the conditional expression,: is required, and when entering the processing content, enter it with a line break.

Odds of Oddness In this problem, if the number of N entered is even, the odd numbers below N will be N / 2, and if N is odd, the odd numbers below N will be N / 2 + 1. It can be solved by using the if statement used. Here we use a new remainder and division. The remainder of x ÷ y is in x% y You can find the quotient of x ÷ y with x / y In this problem, I solved the problem by dividing it into even numbers when the remainder was 0 and odd numbers when it was not 0.

Recommended Posts

Python memo
Python memo
python memo
Python memo
Python memo
Python memo
[Python] Memo dictionary
python beginner memo (9.2-10)
python beginner memo (9.1)
★ Memo ★ Python Iroha
[Python] EDA memo
Python 3 operator memo
[My memo] python
Python3 metaclass memo
[Python] Basemap memo
Python beginner memo (2)
[Python] Numpy memo
Python class (Python learning memo ⑦)
My python environment memo
python openCV installation (memo)
Python module (Python learning memo ④)
Visualization memo by Python
Python
Python test package memo
[Python] Memo about functions
python regular expression memo
Binary search (python2.7) memo
[My memo] python -v / python -V
[Memo] Python3 list sort
Python Tips (my memo)
[Python] Memo about errors
DynamoDB Script Memo (Python)
Python basic memo --Part 2
python recipe book Memo
Python OpenCV tutorial memo
Python basic grammar memo
TensorFlow API memo (Python)
python useful memo links
Python decorator operation memo
Python basic memo --Part 1
Effective Python Memo Item 3
Divisor enumeration Python memo
Python memo (for myself): Array
Python exception handling (Python learning memo ⑥)
Python execution time measurement memo
Twitter graphing memo with Python
Python and ruby slice memo
Python Basic Grammar Memo (Part 1)
Python code memo for yourself
Raspberry Pi + Python + OpenGL memo
Python basic grammar (miscellaneous) Memo (3)
Python immutable type int memo
Python memo using perl --join
Python data type summary memo
[MEMO] [Development environment construction] Python
[Python] virtualenv creation procedure memo
Python basic grammar (miscellaneous) Memo (4)
Regarding speeding up python (memo)
gzip memo
kafka python
Python control syntax, functions (Python learning memo ②)