Python - If, Elif, Else Statement, Use of Indent etc.

Опубликовано: 01 Апрель 2020
на канале: Manish Mahour
122
5

#Python #IfElse

I am demonstrating how we can use If Else Statement.We will take a problem and we will try to solve that problem using If Else statements. The Problem is:

Given an integer, 𝒏, perform the following conditional actions:
If 𝒏 is odd, print Weird
If 𝒏 is even and in the inclusive range of 2 to 5, print Not Weird
If 𝒏 is even and in the inclusive range of 6 to 20, print Weird
If 𝒏 is even and greater than 20, print Not Weird

Constraints
𝟏 ≤𝒏 ≤𝟏𝟎𝟎

Sample Input
6
Sample Output
Weird