Playgrounds
Snippets
Developers
Compiler
All
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
Coffee
CoffeeScript
ColdFusion
Command
CSS
Delphi
Django
ES6
GLSL
Grunt
Gulp
HAML
Haskell
HTML
iOS
Jade
Java
JavaScript
jQuery
JSX
Less
LUA
MDX
MySQL
Objective
Other
Pascal
Perl
PHP
Plain text
PowerShell
Processing
Progress
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
SCSS
SmallBASIC
Smarty
SQL
Stylus
SVG
Swift
TypeScript
VHDL
X++
XHTML
XML
Xojo
XSLT
New snippet
New playground
Sign up
Login
Upload
Playgrounds
Snippets
Developers
Sign up
Login
Codepad is a place for developers to share code snippets (PHP, Java, Bash, C, C++, Python and more). Create your HTML, CSS and JS Demos.
Sign up
Learn more
Sort
Popular
Most liked
Most recent
Time
Today
Last week
Last month
Last year
All time
Select Languages
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
ColdFusion
Command
CSS
Delphi
Django
Grunt
Gulp
HAML
HTML
iOS
Jade
Java
JavaScript
jQuery
Less
MySQL
Objective
Other
Pascal
Perl
PHP
PowerShell
Processing
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
Smarty
SQL
Swift
VHDL
XHTML
XML
Xojo
XSLT
SCSS
CoffeeScript
GLSL
Progress
Stylus
ES6
Coffee
TypeScript
X++
Haskell
SmallBASIC
JSX
SVG
Plain text
LUA
MDX
Apply
Reset
popular • Python
Test
Python
0
0
2497
Truncate HTML to a certain number of words
Python
0
0
2624
Collatz numbers
Python
0
0
3095
Sieve of Eratosthenes
Python
3
0
3136
Collatz 2
Python
0
0
2777
Better Sieve
Python
0
1
3638
Sudoku Checker
Python
5
1
9076
Spiral Matrix
Python
0
0
2984
Tkinter Framework
Python
0
0
2885
hi
Python
0
0
2266
finding a char in a string
Python
0
0
3073
readability.py
Python
0
1
3384
Test python code
Python
1
1
2238
python function decorator
Python
0
1
1889
hello
Python
1
1
1898
Fibonacci sequence
Python
0
8
1780
Oscar Riveros
Python
1
0
1670
Set / Get a tag from a configuration file
Python
0
0
1792
Random Youtube Link Generator
Python
1
3
2828
tarot.py
Python
0
1
1973