Oktatás
* Programozás 1 + feladatsor + GitHub oldal
* Szkriptnyelvek + feladatsor + quick link
Teaching
* Programming 1 (BI) ◇ exercises ◇ quick link
teaching assets
Félévek
* 2024/25/2 * 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
- primitive types and type properties (type(var), sizeof, MIN, MAX, etc.)
- type conversion
- integer overflow
writeln() , write()
- formatted output (
writefln() )
- command-line arguments (
sys.argv )
- 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
- reading from stdin
- 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)
print("X".center(5))
from parse import parse (in D: formattedRead() )
- stringbuffer (
dup() , idup() )
s.zfill()
- 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
- working with Unicode characters (
isLower() , toUpper() )
- static vs. dynamic array
- list operations (a.k.a. dynamic array 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)
- list concatenation (
[1, 2] + [3, 4] )
- list comparison (
[1, 2] == [1, 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
- dictionaries
- set data structure
- tuple data structure
- structs (records)
unittest
- random
split() , join()
- file handling
- templates
- ranges
to_digits() (number to digits: 2025 → [2, 0, 2, 5] )
|
Blogjaim, hobbi projektjeim
* The Ubuntu Incident * Python Adventures * @GitHub * heroku * extra * haladó Python * YouTube listák
Debrecen | la France
[ edit ]
|