예제 #1
0
def Main():
    minR = 6  # Define a constant variable to store the minimum radius required from the user.
    maxR = 20  # Define a constant variable to store the maximum radius required from the user.

    r = GetIntInput(
        "Please enter the radius of the smiley's face (input will be clamped between (%d - %d): "
        % (minR, maxR))
    r = Clamp(
        minR, maxR, r
    )  # Clamp the user specified radius between the constant minimum and maximum.
    print(CreateSmileyStr(r))  # Print the smiley generated to the screen.
    input("Press any key to continue..."
          )  # Display an message so the user know what to do next.
예제 #2
0
def Main():
    print("Welcome to the pyramid program.")
    h = GetIntInput("Please enter the height of the pyramid required: ")
    print(CreatePyramidStr(h))
    input("Press any key to continue...")
예제 #3
0
def Main():
    print("Welcome to the filter numbers program.")
    n = GetIntInput("Please enter the number you wish to be the divider: ")
    print(CreateDivisibleStr(n))
    input("Press any key to continue...")
예제 #4
0
def Main():
    print("Welcome to the prime number program.")
    n = GetIntInput("Please enter the number you wish to be examined: ")
    print("%d is%s a prime number!" % (n, '' if IsPrime(n) else " not"))
    input("Press any key to continue...")
예제 #5
0
def Main():
    s = GetIntInput("Please specify the size of the rectangular triangle: "
                    )  # Get the size of the triangle from the user.
    print(GetRectTrglStr(s))  # Print the triangle generated to the screen.
    input("Press any key to continue..."
          )  # Display an message so the user know what to do next.
예제 #6
0
def Main():
    h = GetIntInput("Please specify the height of the isosceles triangle: "
                    )  # Get the height of the triangle from the user.
    print(GetIsoTriangleStr(h))  # Print the triangle generated to the screen.
    input("Press any key to continue..."
          )  # Display an message so the user know what to do next.
예제 #7
0
def Main():
	print("Welcome to the ever or odd program.")
	n = GetIntInput("Please enter a number: ")
	print("The number %d is %s." % (n, "even" if IsEven(n) else "odd"))
	input("Press any key to continue...")
예제 #8
0
파일: Circle.py 프로젝트: Arzana/INFDEV02-1
def Main():
    d = GetIntInput("Please enter the diameter of the circle: "
                    )  # Get the diameter of the circle from the user.
    print(GetCircleStr(d))  # Print the circle generated to the screen.
    input("Press any key to continue..."
          )  # Display an message so the user know what to do next.
예제 #9
0
def Main():
    print("Welcome to the star program.")
    s = GetIntInput("Please enter the diameter of the star: ")
    print(CreateStarStr(s))
    input("Press any key to continue...")