Python If-Else !! Python Programming !! Hackerrank

Pubblicato il: 12 luglio 2021
sul canale di: 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.


In questa pagina del sito puoi guardare il video online Python If-Else !! Python Programming !! Hackerrank della durata di ore minuti seconda in buona qualità , che l'utente ha caricato The HackersMap 12 luglio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 39 volte e gli è piaciuto 2 spettatori. Buona visione!