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

Complete the code with better explanation..? 

 

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
trending now

Trending now

This is a popular 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