[ create a new paste ] login | about

Link: http://codepad.org/xnVTXscV    [ raw code | output | fork | 1 comment ]

Python, pasted on Nov 2:
1
2
3
4
5
months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

for months, days in zip(months, days):
    print("In "[0] , "there are" [1], "days.")


Output:
1
2
3
4
5
6
7
8
9
10
11
12
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')
('I', 'h', 'days.')


Create a new paste based on this one


Comments:
posted by Carter895 on Nov 2
Obviously I would like it to do what it's supposed to, which is display the month name and associated number of days, because I have no idea where that single 'h' is coming from. Using Python 3.2.2 and get syntax errors whenever I try to set up the print line differently, so that's all I've managed to get for output.
reply