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
2856
Truncate HTML to a certain number of words
Python
0
0
2999
Collatz numbers
Python
0
0
3508
Sieve of Eratosthenes
Python
3
0
3721
Collatz 2
Python
0
0
3159
Better Sieve
Python
0
1
4085
Sudoku Checker
Python
5
1
9581
Spiral Matrix
Python
0
0
3423
Tkinter Framework
Python
0
0
3304
hi
Python
0
0
2566
finding a char in a string
Python
0
0
3409
readability.py
Python
0
1
3784
Test python code
Python
1
1
2551
python function decorator
Python
0
1
2193
hello
Python
1
1
2211
Fibonacci sequence
Python
0
8
2110
Oscar Riveros
Python
1
0
1966
Set / Get a tag from a configuration file
Python
0
0
2067
Random Youtube Link Generator
Python
1
3
3262
tarot.py
Python
0
1
2322