SpongeBob mocking text (spongemock) is a style of writing in which the alphabets are randomly written in upper and lower case. It is used in internet communities to mock something. The text originated as a meme from the SpongeBob cartoon series.
Input : The quick brown fox jumps over the lazy dog. Output : tHE QuiCK BrOWN fOX juMps over tHe lAzY dOG. Input : This sentence is to test the function. Output : This seNtENce is TO TeST THE funcTiON.
- Process the input string by character.
- Check if the character is an alphabet by using
random.random()method to generate a random number between 0 and 1.
- If the number generated is greater than 0.5 then change the character to upper case using
- If the number generated is less than or equal to 0.5 then change the character to lower case using
tHe qUICk BrOWn fox jUMPs oVEr thE lAZy dOG. THIS seNTEncE IS tO TesT tHe FuNcTIOn.
The above code generates the text with equal amount if lower and upper case characters. If we want to skew the balance to favour one side we can switch the
random.random() method with
Spongemock text with more upper case characters : ThE qUICK BROwN FOX jUMPs OVeR THE lazy DoG. Spongemock text with more lower case characters : The qUick BrOwn fOX JuMPs oveR the LaZy DOg.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python - SpongeBob Mocking Text Generator GUI using Tkinter
- Python List Comprehensions vs Generator Expressions
- Python | Random Password Generator using Tkinter
- Automated Certificate generator using Opencv in Python
- Automate getter-setter generator for Java using Python
- Wi-Fi QR Code Generator Using Python
- descendants generator – Python Beautifulsoup
- children generator - Python Beautifulsoup
- Python | Generator Expressions
- Building QR Code Generator Application using PyQt5
- Image Caption Generator using Deep Learning on Flickr8K dataset
- Python: Convert Speech to text and text to Speech
- Convert Text and Text File to PDF using Python
- twitter-text-python (ttp) module - Python
- Formatted text in Linux Terminal using Python
- Reading and Writing to text files in Python
- Tokenize text using NLTK in python
- Convert Text to Speech in Python
- Textwrap – Text wrapping and filling in Python
- Convert Text to Speech in Python using win32com.client
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.