Skip to content
Snippets Groups Projects
Commit 408a709c authored by Iida Pyykkönen's avatar Iida Pyykkönen
Browse files

15 and 17

parent a1ac3aa3
No related branches found
No related tags found
No related merge requests found
15.py 0 → 100644
# Write a function solve that rotates an n x n matrix 90 degrees clockwise in-place.
def solve(matrix):
for i in range(int(len(matrix))):
for j in range(i):
matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
for list in matrix:
list.reverse()
return matrix
17.py 0 → 100644
# Write a function solve that counts the number of vowels (a,e,i,o,u) in a string, ignoring case.
def solve(string):
counter = 0
vowels = ["a","e","i","o","u"]
for char in string.lower():
if char in vowels:
counter += 1
return counter
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment