You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
2.5 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "e839d993-7f9e-4419-92de-eb3dba046640",
"metadata": {},
"source": [
"# add_pen_name"
]
},
{
"cell_type": "markdown",
"id": "b87b3999-97c7-43da-9931-27f319a9f590",
"metadata": {},
"source": [
"___\n",
"\n",
"Add pen names into the list<br> \n",
"\n",
"<img src=\"https://hub.xpub.nl/soupboat/~chae/break-it-down.jpeg\">"
]
},
{
"cell_type": "markdown",
"id": "cf3788e7-7b88-480a-8a4e-8c53eae169e3",
"metadata": {
"tags": []
},
"source": [
"Input:\n",
"- name, string"
]
},
{
"cell_type": "markdown",
"id": "96ccfe4d-a20d-42e6-ad2c-fdfaa6fd2fc5",
"metadata": {
"tags": []
},
"source": [
"Output:\n",
"- name, list"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4a5f59ac-bdfd-4695-8842-80db12bd156e",
"metadata": {},
"outputs": [],
"source": [
"pen_name_list = ['Blibli', 'Chae as Che Gueverq', 'turtle teller']\n",
"\n",
"def add_pen_name(name_input):\n",
" '''add pen name inside the list'''\n",
" if name_input:\n",
" if name_input not in pen_name_list:\n",
" pen_name_list.append(name_input)\n",
" return pen_name_list"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "a9668cd3-54a4-4e1b-baed-f8453965f693",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Blibli', 'Chae as Che Gueverq', 'turtle teller', 'broggle']"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# simple application here\n",
"add_pen_name('broggle')"
]
},
{
"cell_type": "markdown",
"id": "5db35904-9350-428d-9744-a922ebd05784",
"metadata": {},
"source": [
"___\n",
"This function is part of C and G project, ***ETC Portal to Contaminate*** "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "919fd920-f52f-4912-b4e2-d5aa57c5f400",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}