Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function encapsulation
#3
Quote:Now I have tried to replace each print statement in the function print_multiples(n)but cannot get the function to work. Can anyone please advise what to do.
You misunderstood the instructions. The print statement that you want to replace is the one on line 6, like this :

n = 3
def print_multiples(n):
    for i in range(1, 7):
        print(n * i, end="   ")
    print()

for i in range (1, 7) :
	print_multiples(i)
Reply


Messages In This Thread
Function encapsulation - by Oldman45 - Jan-21-2021, 01:32 PM
RE: Function encapsulation - by spaceraiders - Jan-21-2021, 01:34 PM
RE: Function encapsulation - by BashBedlam - Jan-21-2021, 03:33 PM
RE: Function encapsulation - by Oldman45 - Jan-22-2021, 11:32 AM
RE: Function encapsulation - by Oldman45 - Jan-22-2021, 11:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Encapsulation codinglearner 2 2,169 Apr-02-2024, 01:26 PM
Last Post: DataScience
  Preserve Encapsulation while Displaying Information QueenSvetlana 13 9,337 Dec-07-2017, 06:13 PM
Last Post: snippsat
  Encapsulation issue iFunKtion 4 4,920 Mar-07-2017, 10:13 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020