Calculate days in a month

From CompSciWiki
Revision as of 22:13, 3 April 2012 by MaryAnnN (Talk | contribs)

Jump to: navigation, search

COMP 1010 Home > Back to Extra Labs

Introduction

In this program, you will be taught how to use if and else conditional statements in Python.

if/else/elseif syntax in Python

if(expression):

  Statement(s)

elif(expression):

  Statement(s)

else:

  Statement(s)

As you may have noticed, Python uses elif in place of elseif in Java. Also, Python is a little picky about indentation; hence it is recommended that you use the if, elif and else syntax as shown above.

Step 1:

 Bla9; 

Bla2.