Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Second East European Symposium Adbis 98 Poznan Poland September 1998 Proceedings Lncs 1475

Authors: Witold Litwin ,Tadeusz Morzy ,Gottfried Vossen

1st Edition

3540649247, 978-3540649243

More Books

Students also viewed these Databases questions