1 import math 2- #Function I: def func1(n): count 0 sum = 0 3&567∞9 4 8 979982~~~~~~~ 9 10 11- #Function II: 12 - def func2(n): 13 14 15 16 17 18 19 21 22 23 24 20 #Function III: def func3(n): count 0 sum = 0 for i in range(int(math.pow(1.02,n))): sum += i 25 26 for i in range(int(math.log2(n))): sum += i count += 1 print("for n {}: count 31 32 33 count 0 sum = 0 for i in range(int(n*n)): sum += i count += 1 print("for n = {}: count n = [2,10,100,1000, 10000] 30 for i in n: func1(i) func2(i) func3(i) count += 1 print("for n {}: count {}".format(n, count)) {}".format(n, count)) {}".format(n, count))

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

 

. Initialize please. 

 

1 import math
2 #Function I:
3 def func1(n):
4
count
sum 0
for i in range(int(math.log2(n))):
sum += i
count += 1
print("for n = {}: count = {}".format(n, count))
68 69 SA ENT
5
6-
7
9
10
0
11- #Function II:
12 def func2(n):
13
count
14
sum = 0
15
for i in range(int(n*n)):
16
sum += i
17
18
19
20
#Function III:
21 def func3(n):
22
23
24
25
26
27
28
29
30
31
32
33
count += 1
print("for n = {}: count = {}".format(n, count))
count
sum = 0
for i in range(int(math.pow(1.02,n))):
sum +=
count += 1
print("for n = {}: count = {}".format(n, count))
0
n =
for i in n:
func1(i)
func2(i)
func3(i
[2,10,100,1000, 10000]
Transcribed Image Text:1 import math 2 #Function I: 3 def func1(n): 4 count sum 0 for i in range(int(math.log2(n))): sum += i count += 1 print("for n = {}: count = {}".format(n, count)) 68 69 SA ENT 5 6- 7 9 10 0 11- #Function II: 12 def func2(n): 13 count 14 sum = 0 15 for i in range(int(n*n)): 16 sum += i 17 18 19 20 #Function III: 21 def func3(n): 22 23 24 25 26 27 28 29 30 31 32 33 count += 1 print("for n = {}: count = {}".format(n, count)) count sum = 0 for i in range(int(math.pow(1.02,n))): sum += count += 1 print("for n = {}: count = {}".format(n, count)) 0 n = for i in n: func1(i) func2(i) func3(i [2,10,100,1000, 10000]
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY