Student Solution

-->

"Education is the most powerful weapon which you can use to change the world”
– Nelson Mandela

1 University

1 Course

2 Subjects

Assignment-03-ForLoop

Assignment-03-ForLoop

Q Assignment 1 ? Task 1: Find the area of the following graph. f x =4?3 +9?2 +2?+1from ?=2 to ?=3 ? Save your program in Task1.py. ? Task 2: Take 5 numbers by using input() and appending one by one to a list (use a for-loop) and display the sorted result in an ascending order. DO NOT USE sort() method in Python. ? Save your program in Task2.py.

View Related Questions

Solution Preview

# -*- coding: utf-8 -*- """ Created on Mon Feb 22 20:31:46 2021 @author: wcraw """ # f(x) = 4* ^3 + 9* ^2 + 2* + 1??? # integral: area = 228 area = 0 a = 2 b = 3 n = 100 base = (b-a)/n for z in range (0, n-2): x = a + base*z area += area + base * (4*( **3) + 9* **2 + 2* + 1) ???