Skip to content
world = {"Afghanistan":30.55, "Albania":2.77, "Algeria":39.21}
world["luxemburg"]=112233
print(world)
countries = ["Afghanistan", "Albania", "Algeria"]
pop = [30.55, 2.77, 39.21]
ind=countries.index("Algeria")
print(pop[ind])
import matplotlib.pyplot as plt

values=[0,0.6,1.4,1.6,2.2,2.5,2.6,3.2,3.5,3.9,4.2,6]

plt.hist(values)
plt.xlabel('x-as')
plt.ylabel('y-as')
plt.title('TITLE')
plt.yticks([0,1,2],['0','EEN','TWEE'])
plt.show()

import numpy as np
import random as rd

kleurenrij=[]
kleuren=[]

for x in range(7):
    for y in range(7):
        kleur= rd.randint(1,7)
        kleurenrij.append(kleur)
        if y==6:
            kleuren.append(kleurenrij)
            kleurenrij=[]
    
kleurenarr=np.array(kleuren)
print(kleurenarr)
import random
import numpy as np

array_7x7 = [[random.randint(1, 7) for _ in range(7)] for _ in range(7)]
np.array_7x7=np.array(array_7x7)
print(np.array_7x7)

from turtle import * 

#screen = turtle.Screen()
turtle.shape("turtle")
for _ in range(4):
    turtle.forward(100)
    turtle.left(90)
import numpy as np

class driehoek:
    def __init__(self, a=0, b=0):
        self.a = a 
        self.b = b
    
    def c(self):
        return np.sqrt(self.a**2 + self.b**2)
    
kiekeboe = driehoek(3,4)
print(kiekeboe.c())
import numpy as np 

class point:
    def __init__(self, x=0, y=0):
       self.x = x
       self.y = y

    def distance_to_origin(self):
       return np.sqrt(self.x**2+self.y**2)

a=point(3,4)
print(a.distance_to_origin())
#hoe 21 vlakken bepalen in een vlak 70x70 waarbij drie blokken kunnen gebruikt worden 

import random as rd
import numpy as np

def count_unique_items(arr):
    unique_count = {} 
    for item in arr:
        if item in unique_count:
            unique_count[item] += 1
        else:
            unique_count[item] = 1  
    return unique_count

resultaat = []

for turn in range(30000000):
    x = rd.randint(1,100)
    y = rd.randint(1,100)
    z = rd.randint(1,100)
    if x+y+z==21 and (x+2*y+3*z==1 or x+2*y+3*z==4 or x+2*y+3*z==25 or x+2*y+3*z==49 or x+2*y+3*z==100 or x+2*y+3*z==196 or x+2*y+3*z==1225 or x+2*y+3*z==4900) :   
        rij = ( str(x+2*y+3*z) + "    " + str(x+y+z) + "=" + str(x) + "+" + str(y) + "+" + str(z))
        resultaat.append(rij)

unique_items_count = count_unique_items(resultaat)
sorted_unique_items = sorted(unique_items_count.items())

for item, count in sorted_unique_items:
    print(f"{item}: {count}")