Guest User

Untitled

a guest
Feb 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. # Int (Unlimited precision signed integer)
  2. decimal = 10
  3. binary = 0b10
  4. octo = 0o10
  5. hexadecimal =0x10
  6.  
  7. # call to the int constructor can covert floating point to integers, string to integers
  8. int_constructor = int(3.5)
  9. string_conversion = int("496")
  10. base_three = int("10000", 3)
  11.  
  12. # Float IEEE-754 double precision(64-bit), 53 bits of binary precision, 15 to 16 bits of decimal precision
  13. float_number = 3.125
  14. large_sci_number = 3e8
  15. small_sci_number = 1.616e-35
  16.  
  17. # Conversion
  18. from_int = float(7)
  19. from_string = float("1.618")
  20.  
  21. # Special floating point numbers
  22. not_a_number = float(nan)
  23. positive_infinty = float("inf")
  24. negatve_infinity = float("-inf")
  25. float_promotion = 3.12 + 2
  26.  
  27. # None (often used to represent the absence of a value.)
  28. none_value = None
  29. testing_none = none_value is None
  30.  
  31. # Bool (Boolean logical value Either True or False)
  32. true = True
  33. false = False
  34. # Bool constructor (converting other types to bool)
  35. falsey_value = bool(0)
  36. truthy_value = bool(42)
Add Comment
Please, Sign In to add comment