Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
Tihomir Nedev | |
April 2014 | |
Change the values for the network setting. | |
Change the emails. NB! Some sorvers won't accept email for unedentified devices as Arduino. | |
Hardware: Arduino board + Ethernet shield | |
*/ |
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 math | |
def magic_square(matrix): | |
magic_addition = [] | |
addition = 0 | |
counter = 0 | |
counter2 = 0 | |
power = len(matrix) | |
for item in matrix: | |
for element in item: | |
addition+=element |
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
def kill_char(string, n): | |
begin = string[:n] | |
end = string[n+1:] | |
return begin + end | |
def reduce_file_path(path): | |
counter=1 | |
if path[len(path)-1]=='.': | |
path = kill_char(path,len(path)-1) | |
if len(path)>1: |
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
""" | |
Implement a function, called goldbach(n) which returns a list of tupples, that is the goldbach conjecture for the given number n | |
The Goldbach Conjecture states: | |
Every even integer greater than 2 can be expressed as the sum of two primes. | |
Keep in mind that there can be more than one combination of two primes, that sums up to the given number. | |
The result should be sorted by the first item in the tuple. |