Nelogeek

Untitled

Oct 26th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. a = 5
  2. print(a, "is of type", type(a))
  3.  
  4. a = 2.0
  5. print(a, "is of type", type(a))
  6.  
  7. a = 1+2j
  8. print(a, "is complex number?", isinstance(1+2j, complex))
  9.  
  10. a = 1234567890123456789
  11. a
  12.  
  13. b = 0.1234567890123456789
  14. b
  15.  
  16. c = 1+2j
  17. c
  18.  
  19. a = [5,10,15,20,25,30,35,40]
  20. print("a[2] =", a[2])
  21.  
  22. print("a[0:3] =", a[0:3])
  23.  
  24. print("a[5:] =", a[5:])
  25.  
  26. a = [1,2,3]
  27. a[2] = 4
  28. a
  29.  
  30. t = (5,'program', 1+3j)
  31. print("t[1] =", t[1])
  32.  
  33. a = {5,2,3,1,4}
  34. print("a =", a)
  35.  
  36. print(type(a))
  37.  
  38. a = {1,2,2,3,3,3}
  39. a
  40.  
  41. d = {1:'value', 'key':2}
  42. type(d)
  43.  
  44. d = {1:'value', 'key':2}
  45. print("d[1] =", d[1]);
  46.  
  47. float(5)
  48.  
  49. int(10.6)
  50.  
  51. int(-10.6)
  52.  
  53. float('2.5')
  54.  
  55. str(25)
  56.  
  57. set([1,2,3])
  58.  
  59. tuple({5,6,7})
  60.  
  61. list('hello')
  62.  
  63. int("45")
  64.  
  65. str(912)
  66.  
Advertisement
Add Comment
Please, Sign In to add comment