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):
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()
#!/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 |