This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
'A SUITABLE CELBATORY SONG FOR THE BASIC BIRTHDAY PARTY AT PUBSTANDARDS DUBLIN. | |
'In 1964, John G. Kemeny and Thomas E. Kurtz designed the original BASIC language at Dartmouth College in New Hampshire. | |
DIM BDAY AS STRING | |
DIM BAS AS STRING | |
DIM I AS INTEGER | |
DIM Z AS INTEGER | |
DIM VERSES AS INTEGER | |
BDAY = "HAPPY BIRTHDAY TO YOU" | |
BAS = " DEAR BASIC!" | |
INPUT "HOW MANY VERSUS SHALL WE SING" ; VERSES |
This file contains 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
""" | |
This script tests the connection messages across sockets for index voice | |
""" | |
#from vocollect_lut_odr.transports import TransientSocketTransport | |
#import time | |
import socket | |
#from threading import Timer | |
#from vocollect_lut_odr.connections import LutConnection | |
#from vocollect_lut_odr.receivers import StringField, NumericField, Lut | |
#from vocollect_lut_odr.formatters import RecordFormatter |
This file contains 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
#Your optional code here | |
#You can import some modules or create additional functions | |
def checkio(data): | |
#Your code here | |
#It's main function. Don't remove this function | |
#It's used for auto-testing and must return a result for check. | |
data2=[] | |
for x,num in enumerate(data): |
This file contains 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 checkio(data): | |
#replace this for solution | |
length = len(data) | |
data.sort() | |
if length%2 == 0: | |
return (data[int(length/2) - 1] + data[int(length/2)])/2 | |
return data[int(length/2)] |
This file contains 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 checkio(data): | |
ans = False | |
ucase = False | |
lcase= False | |
numeral = False | |
if len(data)<10: | |
return ans | |
for num in data: | |
if num in ('1','2','3','4','5','6','7','8','9','10'): | |
numeral = True |
This file contains 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 checkio(number): | |
if number%3 ==0 and number %5 ==0: | |
return 'Fizz Buzz' | |
elif number%3 ==0: | |
return 'Fizz' | |
elif number%5 ==0: | |
return 'Buzz' | |
return str(number) | |
This file contains 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 subprocess | |
proc = subprocess.Popen("netstat",stdout=subprocess.PIPE,stderr=subprocess.PIPE) | |
data = proc.communicate() | |
print (data) |
This file contains 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 checkio(array): | |
""" | |
sums even-indexes elements and multiply at the last | |
""" | |
length = len(array) | |
if length == 0: | |
return 0 | |
ans = 0 | |
for x in range(length): |
This file contains 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 checkio(words): | |
counter = 0 | |
for part in words.split(): | |
if part.isalpha(): | |
counter = counter +1 | |
elif part.isdigit(): | |
counter = 0 | |
if counter == 3: | |
return True | |
return False |
OlderNewer