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 all 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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Update GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: 'Author Assign'

on:
Expand All @@ -8,6 +9,6 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v1.1.0
- uses: toshimaru/auto-author-assign
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [opened]

jobs:
welcome:
greetings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/stale-issue-and-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Stale Issue And PR

on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
jobs:
stale:
name: 🧹 Clean up stale issues and PRs
runs-on: ubuntu-latest
steps:
- name: 🚀 Stale Issue And PR
uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 7
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,help-wanted"
stale-issue-message: >
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be
marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us
know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and
locked in 7 days if no further activity occurs. Thank you for your contributions!
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has
been marked as stale. This PR will be closed and locked in 7 days if no further activity occurs. Thank you
for your contributions!
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