Placeholder

Python Assignments Triangle and Guessing Number

$19.00

Description

These projects must be done in the latest version of IDLE:
Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is an equilateral triangle.
Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is a right triangle.
Recall from the Pythagorean theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides.
Modify the guessing-game program of Section 3.5, listed below, so that the user thinks of a number that the computer must guess. The computer must make no more than the minimum number of guesses.(Code is as follows)
import random
smaller = int(input(“Enter the smaller number: “))
larger = int(input(“Enter the larger number: “))
myNumber = random.randit(smaller, larger)
count = 0
while True:
count += 1
if userNumber < myNumber:
print(“Too small”)
elif userNumber > myNumber:
print(“Too large”)
else:
print(“Congratulations! You’ve got it in”, count, “tries!”)
break
SCREENSHOTS
SOLUTION
PAYMENT
The solution includes three python programs
Attachments [Move over files to preview content of those files]
Solution.zip (117.22 KB)
Enqilateral-Triangle-Screenshot.png
EquilateralTriangle.py
Guessing-Number-Screenshot.png
GuessingNumber.py
Right-Triangle-Screenshot.png
RightTriangle.py
Preview EquilateralTriangle.py
a = float(input(“Enter the length of first side of a triangle: “)) b = float(input(“Enter the length of second side of a triangle: “)) c = float(input(“Enter the length of third side of a triangle: “)) if (a == b and b == c): print(“The triangle is a equilateral triangle”) else:
xxxx:
xxxxx(“xxx xxxxxxxx xx xxx x xxxxxxxxxxx xxxxxxxx”)
Preview GuessingNumber.py
xxxxxxx = xxx(xxxxx(“xxxxx xxx xxxxxxx xxxxxx: “))
xxxxxx = xxx(xxxxx(“xxxxx xxx xxxxxx xxxxxx: “))
xxxxx(“xxx xxxx xxxxxx xx x xxxxxx xx xxxxx [” + xxxxxx(xxxxxxx) + “, ” + xxxxxx(xxxxxx) + “]”)
xxxxx = 0
xxxxx xxxx:
count += 1 guess = int((smaller + larger) / 2) print (“computer guess is: ” + format(guess)) state = int(input(“Please enter 0/1 if guesses number too low, too high or enter 2 if the guesses is correct: “)) if state == 0: print(“Too small”) smaller = guess
xxxx xxxxx == 1:
xxxxxx = xxxxx
xxxxx(“xxx xxxxx”)
xxxx:
xxxxx(“xxxxxxxxxxxxxxx! xxx’xx xxx xx xx”, xxxxx, “xxxxx!”)
xxxxx
Preview RightTriangle.py
a = float(input(“Enter the length of first side of a triangle: “)) b = float(input(“Enter the length of second side of a triangle: “)) c = float(input(“Enter the length of third side of a triangle: “)) if ((a*a == b*b + c*c) or (a*a + b*b == c*c) or (a*a + c*c == b*b )): print(“The triangle is a right triangle”) else:
xxxx:
xxxxx(“xxx xxxxxxxx xx xxx x xxxxx xxxxxxxx”)
Price: $19
Buy Now
Checkout
Added to cart
Buy More Save More
Buy at least TWO items & save up to 30% OFF your ENTIRE order!
Rack up instant rebates in your shopping cart. Simply add items to your cart, and see the savings add up.
Discounts will automatically be applied on eligible orders.
Project 1 Equilateral Triangle – $7.00
Project 2 Right Triangle – $7.00
Project 3 Guessing Game – $7.00
Add to Cart
Checkout
Added to cart
You May Also Like:
Python Assignments Caesar Cipher
Python Assignments Credit Plan and Series Numbers

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.