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
  • 1,048,767
  • 296
  • 4,058
  • 3,343
James Oshomah
  • 224
  • 2
  • 12

0 Answers0