Skip to content

Instantly share code, notes, and snippets.

@Cr4ck3r
Created March 5, 2017 03:36
Show Gist options
  • Save Cr4ck3r/2c081dfe818642a0f3ea1dfa3c8fb00b to your computer and use it in GitHub Desktop.
Save Cr4ck3r/2c081dfe818642a0f3ea1dfa3c8fb00b to your computer and use it in GitHub Desktop.

Revisions

  1. Cr4ck3r created this gist Mar 5, 2017.
    20 changes: 20 additions & 0 deletions fizzbuzzARGV.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    import sys

    if len(sys.argv)< 2:
    maxn = int(input("Enter the max: "))
    else:
    upper = int(sys.argv[1])

    n = 0
    while n <= maxn:
    if n % 5 == 0 and n % 3 == 0:
    print('FizzBuzz')
    elif n % 3 == 0:
    print('Fizz')
    elif n % 5 == 0:
    print('Buzz')

    else:
    print(n)

    n = n + 1