Guest User

Untitled

a guest
Feb 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #how to create table of any number we created 12
  2. table_12=[]
  3. for i in range(1,121):
  4. if i % 12==0:
  5. table_12.append(i)
  6. print(table_12)
  7.  
  8. #Print multiplication table of 14 from a list in which multiplication table of 12 is stored.
  9. table_14=[]
  10. for i in table_12:
  11. i=i+2
  12. table_14.append(i)
  13.  
  14. print(table_14)
  15.  
  16. table_12=[]
  17. for i in range(1,121):
  18. if i % 12==0:
  19. table_12.append(i)
  20. print(table_12)
  21.  
  22. # [12, 24, 36, 48, 60, 72, 84, 96, 108, 120]
  23.  
  24.  
  25. table_14=[]
  26. for i, j in enumerate(table_12):
  27. table_14.append(j+(i+1)*2)
  28.  
  29. print(table_14)
  30.  
  31. # [14, 28, 42, 56, 70, 84, 98, 112, 126, 140]
Add Comment
Please, Sign In to add comment