Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little python project #4

Merged
merged 3 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Python

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.11]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: test
run: python magic_python/core.py 17. 15
18 changes: 18 additions & 0 deletions magic_python/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys

def my_magic_function(x, y):
return x + y

def main(argv):
if len(argv) == 0:
print("Usage: python core.py number1 [number2 [,,.]]")
return -1

magic_result = 0
for arg in argv:
value = float(arg)
magic_result = my_magic_function(magic_result, value)
print(magic_result)

if __name__ == "__main__":
exit(main(sys.argv[1:]))