Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution to hackerRank Leap Year Python #155

Merged
merged 11 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/author-assign.yml
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
name: 'Author Assign'

on:
pull_request_target:
types: [opened, reopened]

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
14 changes: 14 additions & 0 deletions HackerRank/Leap-year/Problem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## task

Given a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False.

Note that the code stub provided reads from STDIN and passes arguments to the is_leap function. It is only necessary to complete the is_leap function.

## Input Format

Read year, the year to test.


## Output Format

The function must return a Boolean value (True/False). Output is handled by the provided code stub.
13 changes: 13 additions & 0 deletions HackerRank/Leap-year/python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def is_leap(year):
leap = False

# Write your logic here
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
return True
else:
return False

return leap

year = int(input())
print(is_leap(year))
Binary file added HackerRank/Leap-year/python/snapshot1.png
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your screenshot should be after the problem has been solved

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading