|
Oktatás
* Programozás 2 + feladatsor + C feladatsor + Python feladatsor + GitHub oldal
* Szkriptnyelvek + feladatsor + quick link
* Adator. prog. + feladatsor + quick link
Teaching
* Prog. for Data Sci. ◇ exercises ◇ quick link
teaching assets
Félévek
* 2025/26/1 * archívum
Linkek
* kalendárium - munkaszüneti napok '20 * tételsorok * jegyzetek * szakdolgozat / PhD * ösztöndíjak * certificates * C lang. * C++ * C# * Clojure * D lang. * Java * Nim * Scala
[ edit | logout ] [ sandbox | passwd ]
|
Links
Notes
- hello world
- compilers (dmd, gdc, ldc2)
- primitive types and type properties (type(var), sizeof, MIN, MAX, etc.)
- type conversion
- integer overflow
writeln(), write() (also: write to stderr (standard error))
- formatted output (
writefln())
- command-line arguments
- named constants (
#define MAX 10)
- named character entities (♥)
in operator (for strings and lists) [a.k.a. contains()]
- working with big integers [a.k.a.
BigInteger] (2 ** 1024)
- slices (and
safeSlice())
- loops
- binary search
- reading from stdin
- working with Unicode characters (
isLower(), toUpper())
- strings
s.strip(), s.replace(old, new), , s.startswith(), s.endswith(), s.find()
s.upper(), s.lower(), s.capitalize()
s.count()
s.isdigit() (with all())
- strings are immutable,
len(s), "ab" + "cd"
- reverse a string (
s[::-1])
- string slicing (
s[0:2])
- string comparison (
s == t)
- multiline string (
"""…"""), raw string (r"…"), quoted string (s = 'She said: "Get out!"')
- loop over a string char by char (
for c in text:)
print("-" * 10) (repeat a string)
print("X".center(5))
from parse import parse (in D: formattedRead())
- stringbuffer (
dup(), idup())
s.zfill()
- print text in bold (using escape sequences)
- increment a string by 1 (
aa → ab, bc → bd, zz → aaa)
swapCase()
- Hamming distance (using
zip() and count())
- string → list of chars (
list("abc") → ["a", "b", "c"]) [also: convert a char array to a dchar array]
- create a formatted string and store it as a string
iota() (Python: range()) + walkLength()
filter() (Python: list comprehension)
map() (Python: list comprehension)
- math operations
ord(), chr()
hex(n), oct(n), bin(n)
- optional parameters
- switch statement
2 ** 3 == 8
- floating point types (infinity, nan,
isNan())
- Interoperability with C
- static vs. dynamic array
- list operations (a.k.a. dynamic array [slice] operations)
- append to a list, extend a list (
li.append(1), li.extend([1, 2]))
- remove element (
del li[2]), li.remove(elem)
- pop first/last/inner element (
li.pop(0), li.pop(), li.pop(idx))
li.insert(idx, elem) (insert element at a given position)
li.index(elem) (index position of an element)
li.count()
- list concatenation (
[1, 2] + [3, 4])
- list comparison (
[1, 2] == [1, 2])
- operation with every element (
numbers[] *= 2)
- sort in-place (
li.sort())
- reverse in-place (
li.reverse())
- sort in descending order (simple and advanced solutions)
sum(), max(), min()
uniq() elements (sorted(set(li))), i.e. remove duplicates
- mutable slice -> immutable slice (with copy and with transformation)
- dictionaries
- set data structure
- tuple data structure
- structs (records)
- assert and unit testing
- random
split(), join()
- file handling, file operations
- templates
- ranges
to_digits() (number to digits: 2025 → [2, 0, 2, 5])
- exceptions
- processes
- What is true? What is false? (truthy and falsy)
- swap two variables (
a, b = b, a)
- prettify a number (
1234 => 1,234, pretty_number())
- enum
- lambda function
- date and time
- memoization (
@lru_cache)
- permutation
- working with JSON
- std.numeric
- GCD and LCM (greatest common divisor [LNKO] and least common multiple [LKKT])
- Using the GMP library
- scope
fold() (similar to reduce())
- raylib
- calling D from Python
- static variables (inside a function)
- regular expressions (regex, regexp)
|
Blogjaim, hobbi projektjeim
* The Ubuntu Incident * Python Adventures * @GitHub * heroku * extra * haladó Python * YouTube listák
Debrecen | la France
[ edit ]
|