#Names: Craigory Coppola, Joshua Web (Group 9) #Date: 9/6/16 #Purpose: calculate the area of a circle import enderInput multiplier = enderInput.getInt(prompt="How many times would you like your string repeated?") string = input("Enter a string:") print(string*multiplier)
import enderInput n = enderInput.getInt(prompt="How many numbers would you like to add?") sln = 0 for i in range(n): sln += enderInput.getInt(prompt = "Enter number %d" %(i+1)) print(sln)
import enderInput n = enderInput.getInt(prompt="How many numbers would you like to add?") sln = 0 for i in range(n): sln += i**3 print(sln)
#Names: Craigory Coppola, Joshua Web (Group 9) #Date: 9/6/16 #Purpose: Ask for age and validate it. #1 != not equal #2 == equal #3 > greater than #4 < less than import enderInput age = enderInput.getInt(16, 110, "Enter your age:") print("Your age is %d" % (age))
import enderInput count = 0 print("Want to draw a box?") while (True): if (count != 0): print("Want to draw another box? if not type exit at any time.") len = enderInput.getInt(prompt="What is the length?") wid = enderInput.getInt(prompt="What is the width?") char = enderInput.getChar(prompt="What charachter would you like?") for i in range(len): if (i == len - 1 or i == 0): print(char * wid) else: for w in range(wid): if (w == 0): print(char, end="") elif (w == wid - 1): print(char) else: print(" ", end="") count += 1
import enderInput from math import pi def sumN(n): x = 0 for i in range(n): x+=(i+1) return x def sumNCubes(n): x = 0 for i in range(n): x+=(n+1)**3 return x n = enderInput.getInt(prompt="What number would you like to go up to?") print("The sum of the first %d natural numbers is %d, and the sum of the cubes is %d"%(n,sumN(n),sumNCubes(n)))