Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION IS IN PYTHON PLEASE ANSWER IN PYTHON Question 3: 10 points The following program is slightly different from the program in Question 2 1
QUESTION IS IN PYTHON PLEASE ANSWER IN PYTHON
Question 3: 10 points The following program is slightly different from the program in Question 2 1 | sportsList = open ('sports. txt') 2for index in range(1,11): sp = sportsList . readline () print (str (index)+". " ,sp.rstrip ()) (a) (2 points) Compare the output from this program to the previous program. What is the difference? (b) (2 points) What code caused the difference in the output? (c) (2 points) Does the rstrip() function contain any arguments? (d) (2 points) How does it know what string to act upon? (e) (2 points) lstrip) is a similar function. What do you think it does? Question 4: 6 points The following program is slightly different from the program in Question 3 1 sportsList - open ( 'sports.txt') 2 for index in range (1,11): rtsList.readline () sp - spo if len (sp) print (sp.rstrip )) (a) (2 points) How is the output different from Question 3 (b) (2 points) Two functions use what is known as dot (.) notation. What are the two functions? (c) (2 points) Examine the output and explain what the len() function doesStep 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