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

Loops.py #424

Open
christinablakely opened this issue Oct 10, 2019 · 3 comments
Open

Loops.py #424

christinablakely opened this issue Oct 10, 2019 · 3 comments

Comments

@christinablakely
Copy link

https://www.hackerrank.com/challenges/python-loops/problem?isFullScreen=true&h_r=next-challenge&h_v=zen

Expected behavior and actual behavior

Expected behavior:

0
1
4
9
16

Actual behavior:

0
1
4
9
16

Steps to reproduce the problem

N = int(raw_input())
i = 0

while (N >= 1 and N <= 20) and i < N:
print i**2
i += 1

@welcome
Copy link

welcome bot commented Oct 10, 2019

Thanks for helping us improve and opening your first issue here! Someone will address it right away!
While you're waiting, I just wanted to make sure you've had a chance to look at our Readme and Contributing Guidelines.

@laishawadhwa
Copy link

laishawadhwa commented Oct 11, 2019

Your output and expected output are same.
However you can simply use this small piece of code
if __name__ == '__main__': N = int(raw_input()) for i in range(N): print(i**2)

@christinablakely
Copy link
Author

christinablakely commented Oct 14, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants