Counting Sheep – Codewars

Counting Sheep – Codewars

Today I completed the “Counting sheep” kata on Codewars! I began by creating a variable and a for loop to count “sheep” in an array(Trues). However, I also had to account for None values and code the loop to ignore them. Here is the final program!

 

X’s and O’s – Codewars

X’s and O’s – Codewars

Today I completed the “Xs and Os” kata on Codewars! I began by initializing the variables. Then I created a for loop that counts the x’s and o’s and ignores the other characters. Finally, it outputs whether there is an equal amount of each. This is the final code I came up with!

 

“Grasshopper – Create the rooms” – Codewars

“Grasshopper – Create the rooms” – Codewars

Today I completed the “Grasshopper – Create the rooms” kata on Codewars!

When I was writing the code and testing it, at first I couldn’t understand why a syntax error was popping up. I thought I had typed in the syntax of the hash correctly. Then I realized that unless the keys are placed in quotes, they will be referencing variables that don’t exist. Knowing this, I added quotes and the program worked!

Bug Zero Icon

OUR NEWSLETTER