Python If-Else !! Python Programming !! Hackerrank

Publié le: 12 juillet 2021
sur la chaîne: The HackersMap
39
2

#Python
#Hackerrank

Task
Given an integer, n , perform the following conditional actions:

1. If is odd, print Weird
2. If is even and in the inclusive range of 2 to 5 , print Not Weird
3. If is even and in the inclusive range of 6 to 20 , print Weird
4. If is even and greater than 20 , print Not Weird

Input Format

A single line containing a positive integer, n.

Constraints
n in range(1,101)

Output Format

Print Weird if the number is weird. Otherwise, print Not Weird.

Sample Input 0
3
Sample Output 0
Weird
Explanation 0
n=3
n is odd and odd numbers are weird, so print Weird.


Sample Input 1
24
Sample Output 1
Not Weird
Explanation 1
n=24
n greater than 20 and n is even, so it is not weird.


Sur cette page du site, vous pouvez voir la vidéo en ligne Python If-Else !! Python Programming !! Hackerrank durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur The HackersMap 12 juillet 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 39 fois et il a aimé 2 téléspectateurs. Bon visionnage!