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

fizz_buzz.py #148

Open
zhang123-sys opened this issue Mar 23, 2023 · 0 comments
Open

fizz_buzz.py #148

zhang123-sys opened this issue Mar 23, 2023 · 0 comments
Labels

Comments

@zhang123-sys
Copy link

import sys
def fizz_buzz(limit):
    for i in range(1,limit+1):
        if i % 3 == 0:
            print('fizz',end="")
        if i % 5 == 0:
            print('fizz',end="")
        if i % 3 and i % 5:
            print(i)
        else:
            print()

def main():
    fizz_buzz(int(sys.argv[1]))

if __name__=='__main__':
    main()

image

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

No branches or pull requests

1 participant