A Pen by Luciano Strika on CodePen.
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
| <body> | |
| <div class='container-fluid' align='center'> | |
| <div class = 'row'> | |
| <svg width = '100' height = '100' > | |
| <rect width = '100' height = '100'> | |
| </rect> | |
| </svg> | |
| <svg width = '100' height = '100'> | |
| <rect width = '100' height = '100'> |
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
| <body> | |
| <div class = 'container-fluid'> | |
| <div class= 'row'> | |
| <div class = 'col-xs-1'> | |
| <button></button></div> | |
| <div class = 'col-xs-1'> | |
| <button></button></div> | |
| <div class = 'col-xs-1'> | |
| <button></button></div> | |
| <div class = 'col-xs-1'> |
A Pen by Luciano Strika on CodePen.
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
| //calling goldbach(n) will give you two prime numbers that add up to it, as long as n is even. Otherwise it will just return [-1,-1] | |
| function findPrimesLowerThan(n){ | |
| //find all primes less than or equal to the given n number | |
| primes = [2] | |
| current = 3 | |
| while(current<n+1){ | |
| isPrime = true | |
| for (i = 0; i<primes.length;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
| import random | |
| names = ["Albert","John","Richard","Henry","William"] | |
| surnames = ["Goodman","Black","White","Green","Joneson"] | |
| salaries = [500*random.randint(10,30) for _ in range(10)] | |
| def generate_random_person(names, surnames, salaries): | |
| return {"name":random.sample(names,1)[0], | |
| "surname":random.sample(surnames,1)[0], | |
| "salary":random.sample(salaries,1)[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
| df = pd.DataFrame(generate_people(50), | |
| columns=["name","surname","salary"]) | |
| df.to_csv("random_people.csv") |
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
| some_list = [] | |
| for i in range(10): | |
| some_list.append(f(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
| some_list = [f(i) for i in range(10)] |
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 some_function(k): | |
| # some lines of code doing something | |
| # ... | |
| another_list = [] | |
| for i in range(k): | |
| if i%2 ==0: | |
| another_list.append( (i*7 + 5) % 13 ) | |
| else: | |
| another_list.append( (i*5 + 7) % 23 ) |
OlderNewer