Bit predstavlja dvije vrijednosti 0 i 1
1584 : 2 = 792
792 : 2 = 396
396 : 2 = 198
198 : 2 = 99
99 : 2 = 49
49 : 2 = 24
24 : 2 = 12
12 : 2 = 6
6 : 2 = 3
3 : 2 = 1
1 : 2 = 0
0
0
0
0
1
1
0
0
0
1
1
Centralna procesorska jedinica (CPU): dio računara koji izvršava program
najvažnija komponenta
bez procesora računar ne može pokretati programe
# Python program to check if the input number is prime or not
num = 407
# take input from the user
# num = int(input("Enter a number: "))
# prime numbers are greater than 1
if num > 1:
# check for factors
for i in range(2,num):
if (num % i) == 0:
print(num,"is not a prime number")
print(i,"times",num//i,"is",num)
break
else:
print(num,"is a prime number")
# if input number is less than
# or equal to 1, it is not prime
else:
print(num,"is not a prime number")
10110000 – govori Intelovom procesoru da premjesti vrijednost u memoriju
print(“Hello world”)
T. Gaddis: Starting out with Python, 5th Edition, 2020
Testovi tokom nastave | 30% |
Laboratorijske vježbe | 20% |
Završni ispit | 50% |