[PYTHON] Try posting to Qiita for the first time

Check if all the contents of the list are the same (covered with bugs)

Try using reduce.

reduce(lambda x, y: x == y, items)

Oh, I'm angry if it's an empty list, so I have to set the initial value ...

print reduce(lambda x, y: x == y, [])
# TypeError: reduce() of empty sequence with no initial value

print reduce(lambda x, y: x == y, [], True)

... ʻis` would be more refreshing if it were a function.

Postscript You pointed out in a short time. Or rather, if you think about it for a moment, this is no good ... orz

I made a mistake because it was the first time I thought I should post it as a trial Let's keep it as a commandment ...

Postscript When I thought that it would not be viewed at all, I was pointed out for a while, Qiita is amazing ... The title and content are so different that I changed the title of this article and created New Article.

Recommended Posts

Try posting to Qiita for the first time
Let's try Linux for the first time
How to use MkDocs for the first time
Kaggle for the first time (kaggle ①)
Kaguru for the first time
Molecular dynamics simulation to try for the time being
[For self-learning] Go2 for the first time
See python for the first time
Start Django for the first time
Introducing yourself at Qiita for the first time (test post)
[Introduction to Reinforcement Learning] Reinforcement learning to try moving for the time being
MongoDB for the first time in Python
I tried using scrapy for the first time
I tried python programming for the first time.
I tried Mind Meld for the first time
For the first time in Numpy, I will update it from time to time
Try adding an external module to pepper. For the time being, in requests.
GTUG Girls + PyLadiesTokyo Meetup I went to machine learning for the first time
What I got into Python for the first time
I tried Python on Mac for the first time.
Flow memo to move LOCUST for the time being
Register a task in cron for the first time
I tried python on heroku for the first time
Next to Excel, for the time being, jupyter notebook
AI Gaming I tried it for the first time
I will try to summarize the links that seem to be useful for the time being
I want to create a lunch database [EP1] Django study for the first time
I want to create a lunch database [EP1-4] Django study for the first time
I want to move selenium for the time being [for mac]
Summary of stumbling blocks in Django for the first time
For the time being, try using the docomo chat dialogue API
I want to create a Dockerfile for the time being.
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 1 [Environment construction]
Try to introduce the theme to Pelican
Python (from first time to execution)
The fastest way to try EfficientNet
The easiest way to try PyQtGraph
Differences C # engineers felt when learning python for the first time
Java programmer tried to touch Go language (for the time being)
First python ② Try to write code while examining the features of python
Raspberry Pi --1 --First time (Connect a temperature sensor to display the temperature)
Try using FireBase Cloud Firestore in Python for the time being
I tried to create serverless batch processing for the first time with DynamoDB and Step Functions
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 3 [Character recognition using a model]
The story of returning to the front line for the first time in 5 years and refactoring Python Django
Try logging in to qiita with Python
I tried logistic regression analysis for the first time using Titanic data
Qiita's first post (the reason for starting)
Bulk posting to Qiita: Team using Qiita API
Try to face the integration by parts
Set the time zone to Japan Standard Time
How to set the server time to Japanese time
Python Master RTA for the time being
[Python] [Machine learning] Beginners without any knowledge try machine learning for the time being
[Hi Py (Part 1)] I want to make something for the time being, so first set a goal.
First YDK to try with Cisco IOS-XE
Impressions and memorandums when working with VS code for the first time
Technique to stop drawing the screen and reduce the waiting time for baking
Since I'm free, the front-end engineer tried Python (v3.7.5) for the first time.
A simple workaround for bots to try to post tweets with the same content
Looking back on the machine learning competition that I worked on for the first time