@@ -0,0 +1,121 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n",
"1\n",
"1\n"
]
}
],
"source": [
"import numpy\n",
"\n",
"N_M = map(int, raw_input().split())\n",
"a = numpy.array([map(int, raw_input().split())])\n",
"print numpy.prod(numpy.sum(a, axis = 0)) #Output : 10"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"5\n",
" H \n",
" HHH \n",
" HHHHH \n",
" HHHHHHH \n",
"HHHHHHHHH\n"
]
}
],
"source": [
"thickness = int(input())\n",
"c='H'\n",
"for i in range(thickness):\n",
" print((c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1))\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from collections import OrderedDict\n",
"import textwrap\n",
"\n",
"string,k='AB',2\n",
"\n",
"print(\"\\n\".join(\"\".join(OrderedDict.fromkeys(i)) for i in textwrap.wrap(string,k)))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"li=[1,2,3,4,5]\n",
"\n",
"print li[2:]+li[:2]\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print \"hi\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
}