Skip to content

Commit 6b44542

Browse files
committed
finish one 6 kyu
1 parent 97a529f commit 6b44542

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

[6 kyu]Almost Even.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def splitInteger(num,parts):
2+
mul,mod = divmod(num,parts)
3+
return [mul] * parts
4+
5+
print(splitInteger(23,2))
6+
7+
8+
#We need the ability to divide an unknown integer
9+
#into a given number of even parts — or at least as even as they can be.
10+
#The sum of the parts should be the original value,
11+
# but each part should be an integer,
12+
#and they should be as close as possible.

[6 kyu]Evil Autocorrect Prank.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import re
2+
def autocorrect(input):
3+
return re.sub(r'\bu\b|\b[Yy]ou\b|\byou+\b','your sister',input)
4+
5+
print(autocorrect('You'))
6+
7+
#test.assert_equals(autocorrect("u"),"your sister")
8+
#test.assert_equals(autocorrect("you"),"your sister")
9+
#test.assert_equals(autocorrect("Youuuuu"),"your sister")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy