Skip to content

sfwkn/echopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

learn-python

learning python3.7 in vscode

docstring

def power(x, n):
    """Compute the power of a number.

    Arguments:
    * x: a number
    * n: the exponent

    Returns:
    * c: the number x to the power of n

    """
    return x ** n

pytest

%%writefile first.py
def first(l):
    return l[0] if l else None

%%writefile -a first.py

# This is appended to the file.
def test_first():
    assert first([1, 2, 3]) == 1
    assert first([]) is None

!pytest first.py

About

learning python3.7 in vscode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published