Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit d591e589 authored by Loic Huder's avatar Loic Huder
Browse files

Reversing of strings is now given after slicing in pres02

parent bdea945c
......@@ -770,7 +770,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 2,
"metadata": {},
"outputs": [
{
......@@ -862,23 +862,23 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Abcdef fedcba\n",
"Abcdef fedcba\n",
"Abcdef fedcba\n",
"Abcdef fedcba\n",
"Abcdef ABCDEF\n",
"Abcdef ABCDEF\n",
"Abcdef ABCDEF\n",
"Abcdef ABCDEF\n",
"\n"
]
}
],
"source": [
"print((s.capitalize() + ' ' + s[::-1] + '\\n') * 4 ) "
"print((s.capitalize() + ' ' + s.upper() + '\\n') * 4 ) "
]
},
{
......@@ -908,7 +908,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 5,
"metadata": {},
"outputs": [
{
......@@ -917,7 +917,7 @@
"'ce'"
]
},
"execution_count": 44,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
......@@ -930,7 +930,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 6,
"metadata": {},
"outputs": [
{
......@@ -939,7 +939,7 @@
"'cdef'"
]
},
"execution_count": 45,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
......@@ -951,7 +951,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 7,
"metadata": {},
"outputs": [
{
......@@ -960,7 +960,7 @@
"'bcdef'"
]
},
"execution_count": 46,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
......@@ -972,7 +972,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 8,
"metadata": {},
"outputs": [
{
......@@ -981,7 +981,7 @@
"'ab'"
]
},
"execution_count": 47,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
......@@ -991,6 +991,27 @@
"s[:2]"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'fedcba'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# step = -1: goes through the string in reverse order\n",
"s[::-1]"
]
},
{
"cell_type": "markdown",
"metadata": {
......@@ -2459,7 +2480,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.6.7"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment