def finished_projects(unfinished_projects, completed_projects):
while unfinished_projects:
current_project = unfinished_projects.pop()
print('completing project: ' + current_project)
completed_projects.append(current_project)
def show_completed_projects(completed_projects):
print('\nThese projects have been completed:')
for project in completed_projects:
print(project)
unfinished_projects = ['pie-chart', 'bar graph', 'line chart']
completed_projects = []
print(finished_projects(unfinished_projects,completed_projects))
print(show_completed_projects(completed_projects))
Asked
Active
Viewed 48 times
0

Paul R
- 208,748
- 37
- 389
- 560
-
1Because you're not returning anything in either function. You're printing from within the function instead. – 12944qwerty May 12 '21 at 16:49
-
Your functions return `None` so when you call, e.g., `print(show_completed_projects(...))` what is printed is the return value which is `None`. – May 12 '21 at 16:50
2 Answers
1
When you call the function don't add print. Just call the function, that's it.
def finished_projects(unfinished_projects, completed_projects):
while unfinished_projects:
current_project = unfinished_projects.pop()
print('completing project: ' + current_project)
completed_projects.append(current_project)
def show_completed_projects(completed_projects):
print('\nThese projects have been completed:')
for project in completed_projects:
print(project)
unfinished_projects = ['pie-chart', 'bar graph', 'line chart']
completed_projects = []
finished_projects(unfinished_projects,completed_projects)
show_completed_projects(completed_projects)
If you return something then you can use print.

Buddy Bob
- 5,829
- 1
- 13
- 44
0
this is because you are trying to print the return value of the two function which are None, try do this:
finished_projects(unfinished_projects,completed_projects)
show_completed_projects(completed_projects)

Kfir Goldfarb
- 142
- 5