Skip to content

Instantly share code, notes, and snippets.

@PavelEprines
Last active January 31, 2019 09:50
Show Gist options
  • Save PavelEprines/89ae0214c0d7f308997cb0ff630f5d34 to your computer and use it in GitHub Desktop.
Save PavelEprines/89ae0214c0d7f308997cb0ff630f5d34 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{4: ['q', 'w', 'r'], 5: ['e', 't']}\n"
]
}
],
"source": [
"FD = {'q': 4, 'w': 4, 'e': 5, 'r': 4, 't': 5} \n",
"SD = {} \n",
"for i in FD: \n",
" if FD[i] not in SD: \n",
" SD[FD[i]] = [] \n",
" SD[FD[i]].append(i) \n",
"print(SD)"
]
}
],
"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.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment