Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Posts by dino‭

10 posts
71%
+3 −0
Challenges Find the IP address class

Python 3, 56 bytes lambda x:chr(65+f'{int(float(x[:3]))&~8:08b}'.find('0')) Try it online! Takes in the ip address as a string and returns the classification letter. Explanation: x[:...

posted 3y ago by dino‭  ·  edited 3y ago by dino‭

Answer
71%
+3 −0
Challenges Determine whether an integer is square-free

Python3, 39 bytes lambda n:all(n%i**2for i in range(2,n)) Try it online! Makes a list comprehension from the numbers 2 through n of the remainder of the square, and then checks whether the lis...

posted 3y ago by dino‭  ·  edited 3y ago by dino‭

Answer
71%
+3 −0
Challenges Lowercase, but not just the letters

Python 3, 35 bytes lambda x:[chr(ord(i)|32)for i in x] Try it online! Performs a list comprehension on the input string; for each character it: transforms it into the ASCII character code...

posted 2y ago by dino‭

Answer
66%
+2 −0
Challenges Sort letters by height

Python 3, 43 bytes lambda x:sorted(x,key='tibdfghklpqyj'.find) Try it online! Sorts based on index in a sorted string. Inputs as a string and outputs as a list. -14 bytes by replacing .inde...

posted 2y ago by dino‭  ·  edited 2y ago by dino‭

Answer
60%
+1 −0
Challenges Golf golf challenge

Python 3, 108 bytes lambda p,s:"Hole in one:Albatross:Eagle:Birdie:Par:Bogey:Double bogey:Triple bogey".split(':')[s-1and s-p+4] Try it online!

posted 3y ago by dino‭

Answer
60%
+1 −0
Challenges Encode with ROT13.5

Python 3, 145 bytes lambda s:[dict({chr(i+c):chr((i+13)%26+c)for i in range(26)for c in(65,97)},**{chr(i+48):chr((i+5)%10+48)for i in range(10)}).get(c,c)for c in s] Try it online! Generates...

posted 2y ago by dino‭

Answer
50%
+0 −0
Challenges Golf golf challenge

Python 3, 108 bytes lambda p,s:s<2and"Hole in one"or"Par:Bogey:Double bogey:Triple bogey:Albatross:Eagle:Birdie".split(':')[s-p] Try it online! Very similar to my other solution, but hand...

posted 3y ago by dino‭

Answer
50%
+0 −0
Challenges Solve Goldbach's Conjecture

Python 3.8, 112 bytes def f(x):y=[i for i in range(2,x)if not[j for j in range(2,i)if i%j<1]];return[(q,x-q)for q in y if x-q in y][0] Try it online!

posted 3y ago by dino‭

Answer
50%
+0 −0
Challenges Word Count Tool

Python 3.8, 73 bytes lambda x:[len(x.split()),len(x.replace('\n','')),len(''.join(x.split()))] Try it online!

posted 2y ago by dino‭

Answer
50%
+0 −0
Challenges Cumulative Counts

Python 3.8 (pre-release), 69 bytes def f(x,y={},z=[]): for i in x:y[i]=y.get(i,0)+1;z+=[y[i]] return z Try it online! Bonus: theoretical answer if python allowed named assignment with su...

posted 2y ago by dino‭  ·  edited 2y ago by dino‭

Answer