https://projecteuler.net/problem=1
https://progeigo.org/learning/essential-words-600-plus/ Words starting with A
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# author : my page
# account : my page
# my favorite audio : anime song
import sys
#Numbers that allow division
allow_numer_list = [3,5]
if len(sys.argv) != 2 :
    #Enter one argument to accept the use of this application.
    print('To accept the usage of this application, input one argumet.')
    sys.exit(1)
try :
    #Numbers to apply
    apply_number = int(sys.argv[1])
except :
    #This argument is not an available attribute
    print('This argument is not available attribute.')
    sys.exit(1)
#Numbers to get
access_number = 0
#Array
array = range(1, apply_number)
for num in array :
    #Alternative numbers?
    for alternative_num in allow_numer_list :
        #Algorithm that does not avoid?
        # not avoid algorithm
        if num % alternative_num == 0:
            access_number += num
            break
print(access_number)
# python3 test.py 1000
233168
I will study English more.
Recommended Posts