Skip to content

Commit 7c573ac

Browse files
authored
Merge pull request #17 from Utkarsh1504/master
Code changed in Introduction/PythonIfElse.py
2 parents 05ddc09 + 8319e51 commit 7c573ac

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

Hackerrank_Python_Domain.png

-19.4 KB
Loading

Introduction/PythonIfElse.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,18 @@
22
Title : Python If-Else
33
Subdomain : Introduction
44
Domain : Python
5-
Author : Ahmedur Rahman Shovon
6-
Created : 15 July 2016
5+
Author : Utkarsh Mishra
6+
Created : 27 Jan 2021
77
Problem : https://www.hackerrank.com/challenges/py-if-else/problem
88
'''
99
#!/bin/python3
1010

1111
import sys
1212

13+
n = int(input())
14+
if n%2==1 or n in range (5,21):
15+
print("Weird")
16+
else:
17+
print("Not Weird")
1318

14-
N = int(input().strip())
15-
n= N
16-
w = 'Weird'
17-
nw = 'Not Weird'
18-
if n % 2 == 1:
19-
print(w)
20-
elif n % 2 == 0 and (n>=2 and n<5):
21-
print(nw)
22-
elif n % 2 == 0 and (n>=6 and n<=20):
23-
print(w)
24-
elif n % 2 == 0 and (n>20):
25-
print(nw)
19+

0 commit comments

Comments
 (0)