Skip to main content

Application to Determine the Number of Terms Inside a Square Root

Project description

Application to Determine the Number of Terms Inside a Square Root

任意の数字を入力することでその数字のルート内の項を求めることができる。 "You can determine the terms inside the square root of any given number by inputting the number."

使用方法 usage rules↓↓

python3 keisannkadai1.py

コード

以下のPythonコードを使用してください。 Use the Python code below.

#keisannkadai1.py↓↓

import math

def calculate_number_of_terms(number):
    square_root = math.sqrt(number)
    integer_part = int(square_root)
    decimal_part = square_root - integer_part
    return integer_part, decimal_part

def main():
    print("√を外して中の数何条になるかを計算します。")
    number = float(input("数値を入力してください: "))
    # √を外して中の数何条になるかを計算する
    integer_part, decimal_part = calculate_number_of_terms(number)
    # 小数点以下の桁数を表示する
    decimal_places = len(str(decimal_part)) - 2
    print(f"√{number} を外して中の数は {integer_part}+{decimal_part:.{decimal_places}f} になります。")

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file number_of_terms_inside_a_square_root8-0.0.6.tar.gz.

File metadata

File hashes

Hashes for number_of_terms_inside_a_square_root8-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ee7784c50865f468fcaf1a18b93de1e1bd354c4ac24ae4fc58230e35eab5808c
MD5 d9f421f4b3c5e3a49346af9bc871f20e
BLAKE2b-256 e7a147130b0655df14895afcad43a07387689425799c3ffeddd993d672f3fab8

See more details on using hashes here.

File details

Details for the file number_of_terms_inside_a_square_root8-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for number_of_terms_inside_a_square_root8-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c958d63eafc0e843399b3d7392f583ba125ee0300a2016d9cf3ece60fecdc7
MD5 e91e95018903c9a62a6f0a87ffd913ec
BLAKE2b-256 be66448435eaf094bdd0db8cc9a32f0629dcc7937aa84658fcf69390e36ae193

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page