This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person: | |
def __init__(self, first_name, last_name, email, | |
phone_number="010101"): | |
self.first_name = first_name | |
self.last_name = last_name | |
self.email = email | |
self.phone_number = phone_number | |
def polno_ime(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Avto: | |
def __init__(self, letnik, tip_goriva, moc, poraba, kol_goriva, | |
km, rezerva, volumen): | |
self.letnik = letnik | |
self.tip_goriva = tip_goriva | |
self.moc = moc | |
self.poraba = poraba | |
self.kol_goriva = kol_goriva | |
self.km = km | |
self.rezerva = rezerva*volumen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ni nujno, da se class imenuje enako kot datoteka, je pa to smiselna navada, ce imamo zgolj en class | |
class Task(object): | |
def __init__(self, title, done=False): | |
self.title = title | |
self.done = done | |
def output_nice(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table UDELEZENCI | |
( | |
IME TEXT, | |
PRIIMEK TEXT, | |
EMAIL TEXT | |
unique, | |
STAROST INTEGER, | |
VEGETARJANEC TEXT default 'DA' | |
); | |
INSERT INTO UDELEZENCI (IME, PRIIMEK, EMAIL, STAROST, VEGETARJANEC) VALUES ('Filip', 'Koprivec', '[email protected]', 12, 'NE'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
# Povezemo se na bazo | |
conn = sqlite3.connect("baza.sqlite") | |
cursor = conn.cursor() | |
cursor.execute(""" | |
SELECT COUNT(*), cas_vpisa FROM MERITVE | |
GROUP BY cas_vpisa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="style.css"> | |
<title>Moja prva spletna stran</title> | |
<!-- todo: Poglej tole spodaj--> | |
<!-- Doma si poglej kako dodas favicon --> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import matplotlib.pyplot as plt | |
random.seed(2020 + 1 + 4) # 2025 | |
class Svet: | |
def __init__(self, zacetno_stanje, verjetnost_okuzbe=0.42): | |
self.mreza = zacetno_stanje | |
self.generacija = 1 | |
self.sirina = len(self.mreza[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(enumerate(len(niz))): | |
if znak == ' ': | |
presledki.append(i) | |
else: | |
nov_niz += niz[i] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph G { | |
//rankdir="LR"; | |
subgraph cluster_0{ | |
style=filled; | |
color=lightgray; | |
//1; | |
} | |
subgraph cluster_1{ | |
style=filled; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Random.init 2020 | |
type num = float | |
type distr_t = bool | |
let one: num = 1.0 | |
let half: num = 0.5 | |
let zero: num = 0.0 |