Talk:Main Page

From Computer Science Wiki
Jump to: navigation, search

About Revision 11/6

The revision replace Latest with Hot Topics and rearranged a bit.

Table of Contents

Thomas.curry 23:37, 22 February 2008 (GMT-5) On Lab 8, Task 4, m is an "argument." How can this work with words? In the shell I type isMonth(<letters>) (or just one), and an error appears, but entering any random number lets the program run correctly. Here's the code:

def isMonth(m):

   m = raw_input("Enter a word:  ")
   m = m.upper()
   m = m[0:3]
   months = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JULY", "AUG", "SEP", "OCT", "NOV", "DEC"]
   if m in months:
       return True
   else:
       return False
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox