Tags » Never Stop Learning

Daily Code Challenge: Day 12

Yes, yes. I know. It has been almost 3 weeks since I have posted anything. The Kilted Artist blog is currently on hiatus and i haven’t posted elsewhere due to either being business or depression (and anxiety added to that at the moment). 235 more words

Code

“For the things we have to learn before we can do them, we learn by doing them.”
― Aristotle

Did you find this quote INTERESTING? Feel FREE to SHARE IT to others. Thank you! :)

Quote

Daily Code Challenge: Day 11

Yep, I feel behind on this as well.

squares = []
for value in range(1,11):
    square = value**2
    squares.append(square)
for square in squares:
    print(square)

This is from Python Crash Course.

88 more words
Code

Daily Code Challenge: Day 10

ipAddress = input("Please enter an IP address: ")

position = 1
segment = 1
number = ''
errorMessage = ''

for digit in ipAddress:
    if digit != '.':
        # we havent got a full stop, so we should have a digit
        if digit in '0123456789':
            number += digit
        else:
            errorMessage = "Error in position {} in section {}, invalid character {}".format(position, segment,digit)
            break
    else:
        # we have a full stop, check the length of the number that we've built up so far
        if(len(number) == 0) or (len(number) > 3):
            errorMessage = "Error near position {} in section {}, each number must be 1 to 3 digits".format(position,segment)
            break
        number = ''
        segment += 1
        if segment > 4:
            errorMessage = "Error near position {}, IP address contains more than 4 segments".format(position)
            break
    position += 1
else:
    if(len(number) == 0) or (len(number) > 3):
        errorMessage = "Error near position {} in section {}, each number must be 1 to 3 digits".format(position, segment)
    elif position > 16:
        errorMessage = "Error: IP address can not be more than 15 characters, {} found".format(position)
    elif segment != 4:
        errorMessage = "Error near position {}, IP address contains {} segments, 4 required".format(position, segment)
    else:
        print("ping {}".format(ipAddress))
if errorMessage:
    print(ipAddress)
    print(' ' * (position -1) + '^')
    print(errorMessage)
290 more words
Code

Daily Code Challenge: Day 9

count = 0

while count <= 100:
    if count % 5 == 0 and count % 3 == 0:
        print("FizzBuzz")
    elif count % 5 == 0:
        print("fizz")
    elif count % 3 == 0:
        print("buzz")
    else:
        print(count)
    count += 1…
111 more words
Code

Daily Code Challenge: Day 8

names = ["Terrance", "Ben", "Meredith", "Hatlaban", "Aaron"]

nameNum = 0

while nameNum < 5:
    print("Hello, ", names)
    nameNum += 1

This is something I have been playing with on my own.

121 more words
Code

Daily Code Challenge: Day 7

void setup()
{
size(250,250);
}

void draw()
{
line(0,0,250,250);
}

Ok, so this looks very different than what I have been posting previously. I am also breaking one of my own rules: 5-12 lines of code.

135 more words
Code