Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How many times does the following loop display: Enter a name: ? while True: name = input('Tner a name: ') if name == :
How many times does the following loop display: Enter a name: ?
while True:
name = input('Tner a name: ')
if name == "" :
break
print('Hello!')
print('Bye!')
a. One b. Zero or more c. One or more d. Zero
2. Write a recursive function in Python, sum_first(n), that returns the sum of the first n integers, where n can be an integer between 0 and 5000. For example:
sum_first(0) returns 0
sum_first(1) returns 1
sum_first(2) returns 3
sum_first(3)returns 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started