Skip to content

Instantly share code, notes, and snippets.

@KevinLiebergen
Last active May 27, 2021 09:28
Show Gist options
  • Save KevinLiebergen/b898f12295386f7df04d45741ff9fd86 to your computer and use it in GitHub Desktop.
Save KevinLiebergen/b898f12295386f7df04d45741ff9fd86 to your computer and use it in GitHub Desktop.
Declare python types
>>> t = [25, "mayo", 19]
>>> type(t)
<class 'list'>
>>> t = (25, "mayo", 19)
>>> type(t)
<class 'tuple'>
>>> t = {25, "mayo", 19}
>>> type(t)
<class 'set'>
>>> t = {'precio': 25, 'mes': 'mayo', 'dia': 19}
>>> type(t)
<class 'dict'>
import os
print(__file__)
print(os.path.realpath(__file__))
print(os.path.dirname(os.path.realpath(__file__)))
$ python3 rutas.py
rutas.py
/home/kevinvanliebergen/rutas.py
/home/kevinvanliebergen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment