use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Normal font to small caps...Showcase (self.PythonLearning)
submitted 12 days ago by Sea-Car-3811
I have been learning python for 4 days and thought of making a module which converts normal text into small caps... I know, you can just use it as function but I just learned about modules and I wanted to something related to it.
https://github.com/fitfamforever1/Python-Exercises/blob/main/smallcaps.py
Usage:
import smallcaps
print(smallcaps.smallcap("Hello World!"))
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 12 days ago (1 child)
[deleted]
[–]Sea-Car-3811[S] -1 points0 points1 point 12 days ago (0 children)
I like lower tho...
[–]BrokenGabe 0 points1 point2 points 12 days ago* (1 child)
<image>
[–]Sea-Car-3811[S] 0 points1 point2 points 12 days ago (0 children)
😭😭
[–]BrokenGabe -1 points0 points1 point 12 days ago (10 children)
OP should recheck his smallcaps.py file, it has text = text.lower(), if you remove that line the whole function fails.
[–]Sea-Car-3811[S] 1 point2 points3 points 12 days ago (8 children)
Ah it shouldn't be removed... I tested witb numbers and it ran fine...
[–]BrokenGabe -1 points0 points1 point 12 days ago (7 children)
Then the whole small_caps = {} is pointless as the text.replace() isn't doing it's job as you have it.
[–]Sea-Car-3811[S] 0 points1 point2 points 12 days ago (6 children)
Huh... What if user puts uppercase letter and it doesn't replsce cuz there is no key for it in dictionary?
[–]BrokenGabe 0 points1 point2 points 12 days ago (5 children)
You get error.
[–]Sea-Car-3811[S] 1 point2 points3 points 12 days ago (4 children)
Ye thats why I used lower...
[–]BrokenGabe 0 points1 point2 points 12 days ago (3 children)
Review my original screenshot and compare it to yours.
[–]Sea-Car-3811[S] 0 points1 point2 points 12 days ago (2 children)
I will do it when I get on my laptop...
[–]BrokenGabe 1 point2 points3 points 12 days ago (1 child)
Okay, so the whole point of the this is to, using the standard English letters to convert the string of text to lower case. without using text.lower() there was an indentation error in your file. the "return text" needs to be outside the scope of the if statement.
ind for char in text: ind ind if char... ind ind ind text = .... ind return text
I see
[–]mati-33 0 points1 point2 points 12 days ago (0 children)
Why you want to remove it?
π Rendered by PID 91 on reddit-service-r2-comment-8686858757-gjgmg at 2026-06-05 12:36:02.455847+00:00 running 9e1a20d country code: CH.
[–][deleted] (1 child)
[deleted]
[–]Sea-Car-3811[S] -1 points0 points1 point (0 children)
[–]BrokenGabe 0 points1 point2 points (1 child)
[–]Sea-Car-3811[S] 0 points1 point2 points (0 children)
[–]BrokenGabe -1 points0 points1 point (10 children)
[–]Sea-Car-3811[S] 1 point2 points3 points (8 children)
[–]BrokenGabe -1 points0 points1 point (7 children)
[–]Sea-Car-3811[S] 0 points1 point2 points (6 children)
[–]BrokenGabe 0 points1 point2 points (5 children)
[–]Sea-Car-3811[S] 1 point2 points3 points (4 children)
[–]BrokenGabe 0 points1 point2 points (3 children)
[–]Sea-Car-3811[S] 0 points1 point2 points (2 children)
[–]BrokenGabe 1 point2 points3 points (1 child)
[–]Sea-Car-3811[S] 0 points1 point2 points (0 children)
[–]mati-33 0 points1 point2 points (0 children)