{ "cells": [ { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# value별로 값을 다르게 주고싶어서 진행\n", "\n", "hash_tags = ['코딩','개발자','빅데이터','머신러닝','딥러닝','coding','developer','bigdata','machinelearning','deeplearning']\n", "most_like_tags = ['코딩','개발자','빅데이터']\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "for hash_tag in hash_tags:\n", " if any(e in hash_tag for e in most_like_tags):\n", " count_number = 100\n", " else:\n", " count_number = 20" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "any(iterable)\n", "- Return True if bool(x) is True for any x in the iterable." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false } }, "nbformat": 4, "nbformat_minor": 2 }