Guest User

Untitled

a guest
Jan 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. >>> row = ["1", "bob", "developer", "python"]
  2. >>> print(','.join(str(x) for x in row))
  3. 1,bob,developer,python
  4.  
  5. is same as
  6.  
  7. >>> print(*row, sep=',')
  8. 1,bob,developer,python
  9.  
  10.  
  11. >>> iterable = ['a','b','c']
  12. >>> c = 0
  13. >>> for item in iterable:
  14. >>> print c, item
  15. >>> c+= 1
  16. 0 a
  17. 1 b
  18. 2 c
  19.  
  20. is same as
  21.  
  22. >>> for c, item in enumerate(iterable):
  23. >>> print c, item
Add Comment
Please, Sign In to add comment