w3docs logo
Books
Learn HTML Learn CSS Learn Git Learn Javascript Learn PHP Learn python Learn Java
Exercises
HTML JavaScript Git CSS PHP
Courses Quizzes Snippets
Tools
General Tools
  • Typing Test
  • Password Generator
  • HTML Editor
  • HTML Encoder
  • Base 64
  • Code Diff
  • JSON Beautifier
  • CSS Beautifier
  • Markdown Convertor
  • Tailwind CSS Color
  • Phrase encrypt / decrypt
  • Browser Feature Detection
Color Tools
  • Color Picker
  • Colors CMYK
  • Colors HWB
  • Colors HSL
  • Color Hex
  • Color mixer
  • Color Converter
  • Colors RGB
  • Color Contrast Analyzer
  • Color Gradient
String Tools
  • String Length Calculator
  • String to MD5 Hash Generator
  • String to Sha256 Hash Generator
  • String Reverse
  • URL Encoder
  • URL Decoder
  • Base 64 Encoder
  • Base 64 Decoder
  • Extra Spaces Remover
  • String to Lowercase Converter
  • String to Uppercase Converter
  • String Word Count
  • Empty Lines Remover
  • HTML Tags Remover
  • Binary Data to Hex Converter
  • Hex Encoded Binary String Decoder
  • Rot13 to Text Converter
  • String to Binary Converter
  • Duplicate Lines Remover
Code Formatters
  • JavaScript Formatter
  • CSS Formatter
  • HTML Formatter
  • Json Formatter
  • PHP Formatter
CSS Maker
  • CSS Maker
  • CSS Maker Text Shadow
  • CSS Maker Text Rotation
  • CSS Maker Outline
  • CSS Maker RGB Shadow
  • CSS Maker Transform
  • CSS Maker Font Face
  • Books
    • Learn HTML
    • Learn CSS
    • Learn Git
    • Learn Javascript
    • Learn PHP
    • Learn python
    • Learn Java
  • How To
    • How To NodeJs
    • How To Linux
    • How To AngularJs
    • How To PHP
    • How To HTML
    • How To CSS
    • How To Symfony
    • How To Google Maps
    • How To Git
    • How To Apache
    • How To JavaScript
    • How To Java
    • How To Vue.js
    • How To Python
  1. Snippets
  2. ›
  3. python-2.x

How-to articles, tricks, and solutions about PYTHON-2.X

How to return dictionary keys as a list in Python?

In Python, you can use the dict.keys() method to return a view object that contains the keys of a dictionary.

list python dictionary python-3.x python-2.x

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)

This error is raised when trying to encode a Unicode string using the ASCII codec, and the string contains a character that is not within the ASCII range (0-127).

python unicode python-2.x beautifulsoup python-unicode

What exactly do "u" and "r" string prefixes do, and what are raw string literals?

In Python, the "r" prefix before a string denotes that it is a raw string literal.

python unicode python-2.x rawstring

What is __future__ in Python used for and how/when to use it, and how it works

The __future__ module in Python allows you to enable new language features which are not compatible with the current version of Python.

python python-2.x

What is the difference between dict.items() and dict.iteritems() in Python2?

In Python 2, dict.items() returns a list of the dictionary's key-value pairs, whereas dict.iteritems() returns an iterator over the dictionary's key-value pairs.

python dictionary python-2.x

What is the difference between range and xrange functions in Python 2.X?

In Python 2.X, range and xrange are used to generate a sequence of numbers.

python loops range python-2.x xrange
  • Quizzes
    • HTML Basic
    • CSS Basic
    • Javascript Basic
    • PHP basic
    • ES6 Basic
    • TypeScript Basic
    • Angular Basic
    • React Basic
    • Sass Basic
    • Vue.js Basic
    • Git Basic
    • SQL Basic
  • Snippets
    • How To NodeJs
    • How To Linux
    • How To AngularJs
    • How To PHP
    • How To HTML
    • How To CSS
    • How To Symfony
    • How To Google Maps
    • How To Git
    • How To Apache
    • How To JavaScript
    • How To Java
    • How To Vue.js
    • How To Python
  • Our Books
    • Learn HTML
    • Learn CSS
    • Learn Git
    • Learn Javascript
    • Learn PHP
    • Learn python
    • Learn Java
    • Exercises
    • HTML
    • JavaScript
    • Git
    • CSS
    • PHP
  • Our Tools
    • Typing Test
    • Color Picker
    • HTML Encoder
    • Browser Feature Detection
    • HTML Editor
    • Phrase encrypt / decrypt
    • JavaScript Formatter
    • CSS Maker
    • Password Generator
    • Base 64
    • Code Diff
    • JSON Beautifier
    • CSS Beautifier
    • Tailwind CSS Color
    • Markdown Convertor
  • String Functions
    • String Length Calculator
    • String to MD5 Hash Generator
    • String to Sha256 Hash Generator
    • String Reverse
    • URL Encoder
    • URL Decoder
    • Base 64 Encoder
    • Base 64 Decoder
    • Extra Spaces Remover
    • String to Lowercase Converter
  • About Us
  • Privacy Policy for W3Docs
logo
Follow Us facebook twitter
Company © W3docs. All rights reserved.