Skip to main content

stern pypi PyPI - Downloads PyPI - License Total lines

stern

stern is a free and open-source library by developer saivan

We need your help to make stern the best it can be! New contributors are welcome.

Installation

pip install stern

Examples Programs

Computing the difference between creation Python and PyPI:

import stern
def sumAB(a,b):
    return a - b
print(sumAB(2003, 1991))

Written five times Hello beautiful world of programming!:

import stern
def SealN():
    n=5
    string="Hello beautiful world of programming! "
    print(string * n)
SealN()

Flip the line to the other side:

import stern
def flip():
    a = "stern"
    print(a[::-1])
flip()

Moving x and y:

import stern
def IPS():
    x = 91
    y = 56
    print(x,y)
    x, y = y, x
    print(x,y)
IPS()

Case of Letters:

import stern
def letters():
    s = "sTeRn"
    print(s.lower())
    print(s.upper())
letters()

Spelling a word:

import stern
def listletters():
    s = "stern"
    print(list(s))
listletters()

Unique or NOT unique list:

import stern
def unique():
    x = [1,9,9,1]
    if(len(x) == len(set(x))):
        print("The list is unique")
    else:
        print("The list is NOT unique")
unique()

For Else construct:

import stern
def forelse():
    numbers = [2,4,6,8,1]
    for number in numbers:
        if number % 2 == 1:
            print(number)
            break
        else:
            print("No odd numbers")
forelse()

Difference between == u is:

import stern
def difference():
    first = [1,2,3]
    second = [1,2,3]
    print(first == second)
    print(first is second)
    third = first
    print(first is third)
difference()

Removing duplicates:

import stern
def duplicates():
    list_numbers = [20,22,24,26,28,28,20,30,24]
    print('Before:',list_numbers)
    list_numbers = list(set(list_numbers))
    print('After:',list_numbers)
duplicates()

Exchanging Values with Tuples:

import stern
def EVT():
    a, b = 1, 2
    print(a, b)
    a, b = b, a
    print(a, b)
EVT()

String Concatenation:

import stern
def StringConcatenation():
    a = ["stern", "-", "is good", "module."]
    print(" ".join(a))
StringConcatenation()

Dictionary and set generators:

import stern
def DictionaryGenerators():
    S = {i**2 for i in range(10)}
    D = {i: i**2 for i in range(10)}
    print(S)
    print(D)
DictionaryGenerators()

Output with print:

import stern
def Output():
    for part in ["stern ", "is ", "good", "\n"]:
        print(part, end='')
Output()

Finding the Most Duplicate Items in a List:

import stern
def FMDIL():
    a = [1, 2, 3, 1, 2, 3, 2, 2, 4, 5, 1]
    print(max(set(a), key=a.count))
FMDIL()

Kwargs:

import stern
def Kwargs():
    dictionary = {"a": 1, "b": 2}
    def some_function(a, b):
        print(a + b)
        return
    some_function(**dictionary)
    some_function(a=1, b=2)

Help

If you are just getting started with stern, you should be able to get started fairly quickly.

The online documentation stays up to date with the development version of stern on github. This may be a bit newer than the version of stern you are using. To upgrade to the latest full release, run pip install stern --upgrade in your terminal.

Contribute

Support

If you are having issues, please let us know. We have a mailing list located at: vasilsalkou@gmail.com with subject as stern.

Building From Source

If you want to use features that are currently in development, or you want to contribute to stern, you will need to build stern locally from its source code, rather than pip installing it.

Installing from source is fairly automated. The most work will involve compiling and installing all the stern dependencies. Once that is done, run the setup.py script which will attempt to auto-configure, build, and install stern.

License

This library is distributed under GNU General Public License v3.0, which can be found in the file LICENSE. We reserve the right to place future versions of this library under a different license. This basically means you can use stern in any project you want, but if you make any changes or additions to stern itself, those must be released with a compatible license (preferably submitted back to the stern project). forthebadge made-with-python

I 💖⚙️ STERN

Metadata

Release files for stern 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stern 2.0
File Size Uploaded
stern-2.0.tar.gz 4.3 kB Details

Release files / stern-2.0.tar.gz

Download URL stern-2.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
20fcd0ee91ca03e58c7b29542a8a7b079cf642286c6333439d3eb6c58afd858d
BLAKE2b-256 checksum
How to use checksums
3c5d4f6d3a4a8ba90d809be6003f27a748fa08a41b5e795b1d07aa1eb0fa2041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

2.0 This release

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page