0

Hi please am new to python coming from a visual basic .net framework. Trying to follow a tutorial on http://lightbird.net/dbe/blog2.html. There is a line of code i really don't understand. Please can someone explain it to me. Thanks

 import time
 from calendar import month_name
 year, month = time.localtime()[:2]

The confusion for me is that the variable year and month is their value both time.localtime()[:2]. Any clarification will be highly appreciated.

Martijn Pieters
  • 963,270
  • 265
  • 3,804
  • 3,187
James Oshomah
  • 224
  • 2
  • 12

0 Answers0