Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.51 KB

README.md

File metadata and controls

53 lines (43 loc) · 1.51 KB

CnPython

Implementing most of pythons builtin functions in C, making it easier to read.

Compile

Go to the makefile and adjust it to your needs.

How to contribute

Just create an issue if you have an idea for a builtin function or create a new pull request if you can also write the code for that. When I will have more time to spend on this project I will definetly contribute a little bit more.

Implemented functions

  • type(var),
  • bin(decimal),
  • hex(decimal),
  • oct(decimal),
  • pow(base, exponent),
  • str(number),
  • _int(string),
  • input(prompt),
  • reverse(arr, size),
  • min(arr, size),
  • max(arr, size),
  • print(*format, ...),
  • sorted(arr, size),
  • sum(arr, size),
  • str_len(str),
  • str_count(str, find),
  • endswith(str, element),
  • replace(str, find, repl),
  • find(str, find),
  • startswith(str, element),
  • str_split(arr, str, del),
  • printSplit(str, del),
  • split(arr, str, del)
  • chr(ascii)
  • ord(char)
  • isin(str, value)
  • rem(a, b)
  • percentage(p, n)
  • iappend(arr, value, size)
  • copy(arr, dest, size)
  • arr_count(arr, value, size)
  • arr_find(arr, value, size)
  • pop(arr, size)

License

This code is under a MIT license. This means you can do whatever you want with the code but the same license has to be in your project if you want to use this in your project.