Write a function that can sum up numbers:
- It should receive a sequence of n numbers.
- If no argument is provided, return sum of numbers 1..100.
- Look closely to the type of the function's default argument ...
def sum_numbers(numbers=None):
#-*- coding:utf-8 -*- | |
from Tkinter import * | |
#funciones de procesamiento | |
def procesar(): | |
resultado = peso.get() + altura.get() | |
print resultado | |
#Instancia de la clase Tk | |
ventana = Tk() |
#!/bin/bash | |
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl | |
sudo pip install virtualenvwrapper | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc |
Write a simple Promo class. Its constructor receives two variables: name (which must be a string) and expires (which must be a datetime object).
Add a property called expired which returns a boolean value indicating whether the promo has expired or not.
from datetime import datetime, timedelta
NOW = datetime.now()
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch |
python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)' |