Net-informations.com
SiteMap  | About    

What are literals in python?

A literal is a succinct and easily visible way to write a value. Literals represent the possible choices in primitive types for that language. Some of the choices of types of literals are often integers, floating point, Booleans and character strings. Python support the following literals:

  1. String literals   ::   "halo" , '12345'
  2. Int literals   ::   0,1,2,-1,-2
  3. Long literals   ::   89675L
  4. Float literals   ::   3.14
  5. Complex literals   ::   12j
  6. Boolean literals   ::   True or False
  7. Special literals   ::   None
  8. Unicode literals   ::   u"hello"
  9. List literals   ::   [], [5,6,7]
  10. Tuple literals   ::   (), (9,),(8,9,0)
  11. Dict literals   ::   {}, {'x':1}
  12. Set literals   ::   {8,9,10}









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.