ctf-resources/htb/hacktheboo2024/coding/[Very Easy] oddly_even
2024-10-23 11:10:43 +02:00
..
challenge added official hacktheboo2024 writeups 2024-10-23 11:10:43 +02:00
solutions added official hacktheboo2024 writeups 2024-10-23 11:10:43 +02:00
build_docker.sh added official hacktheboo2024 writeups 2024-10-23 11:10:43 +02:00
Dockerfile added official hacktheboo2024 writeups 2024-10-23 11:10:43 +02:00
README.md added official hacktheboo2024 writeups 2024-10-23 11:10:43 +02:00

img

Oddly Even

1st October 2024

Prepared By: ir0nstone

Challenge Author(s): ir0nstone

Difficulty: Very Easy

Synopsis

Given a number, print "even" if it is even and "odd" if it is odd.

Skills Required

  • Basic Python

Solution

First, we take in the number:

a = int(input())

We can then check if the number is divisible by 2. If it is, we print "even", otherwise we print "odd".

if a % 2 == 0:
    print('even')
else:
    print('odd')