Thursday, April 14, 2016

30 Days of Code Challenges : (Day 3) Intro to Conditional Statements

--------------------------------------------------------------------
#!/bin/python

import sys


n = int(raw_input().strip())
if n%2!=0:
    print "Weird"
elif n>=2 and n<=5:
    print "Not Weird"
elif n>=6 and n<=20:
    print "Weird"
elif n>20:
    print "Not Weird"
--------------------------------------------------------------------

No comments:

Post a Comment

Two Sum

Given an array of integers, return indices of the two numbers such that they add up to specific target. You may assume that each input w...