Fizz Buzz

Problem: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. f = lambda x: 'FizzBuzz' if not (x%5 or x%3) else 'Fizz' if not x%3 else 'Buzz' if not x%5 else str(x) for x in range(100): print(f(x)) Fizz Buzz problem

एप्रिल 22, 2014 · 1 min · 73 words · शंतनू

Free Speech

एप्रिल 18, 2014 · 0 min · 0 words · शंतनू

Using timezone with datetime in python

>>> import pytz >>> import datetime >>> tz = pytz.timezone('Asia/Calcutta') >>> tz <DstTzInfo 'Asia/Calcutta' HMT+5:53:00 STD> >>> t = tz.localize(datetime.datetime(2014, 4, 5, 6, 7, 8, 900)) >>> t datetime.datetime(2014, 4, 5, 6, 7, 8, 900, tzinfo=<DstTzInfo 'Asia/Calcutta' IST+5:30:00 STD>) >>> t.isoformat() '2014-04-05T06:07:08.000900+05:30' Reference: Python datetime object show wrong timezone offset

एप्रिल 5, 2014 · 1 min · 50 words · शंतनू

Toot

मार्च 8, 2014 · 0 min · 0 words · शंतनू

Flowchart

डिसेंबर 25, 2013 · 0 min · 0 words · शंतनू