Question: Using Python: 2) A right-angle triangle has two sides of a = 3 and b = 4. Using Python and Pythagorean theorem (c 2 =

Using Python:

2) A right-angle triangle has two sides of a = 3 and b = 4. Using Python and Pythagorean theorem (c2 = a2 + b2), find the length of variable c. Print variable c to the console. (Hint: square root is equal to the power of 1/2)

3) Assign any integer to variable x. Create an if statement, if x is divisible by 2, then print x is even replacing x with the actual variable. If x is not divisible by 2, then print x is odd.

4) Create a list named alphabet containing the values a,b,c,d,e,f,g. Iterate through the list with a for-loop, printing the respective value of each loop.

5) Create a list named addition containing the values 2,128,16,32,8,64,4. Sort the list using the sort function in Python. Create a variable named total_value. Iterate through the list with a for-loop, adding the value to total_value. Print the final result of total_value to the console.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!