Answered step by step
Verified Expert Solution
Question
1 Approved Answer
****************** PYTHON ********************** Link= https://docs.python.org/3/tutorial/datastructures.html >>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana'] >>> fruits.count('apple') In [ ]: >>> fruits.count('tangerine') In [ ]:
****************** PYTHON **********************
Link= https://docs.python.org/3/tutorial/datastructures.html
>>> fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana'] >>> fruits.count('apple')
In [ ]:
>>> fruits.count('tangerine')
In [ ]:
>>> fruits.index('banana')
In [ ]:
>>> fruits.index('banana', 4) # Find next banana starting a position 4
In [ ]:
>>> fruits.reverse() >>> fruits
In [ ]:
>>> fruits.append('grape') >>> fruits
In [ ]:
>>> fruits.sort() >>> fruits
In [ ]:
>>> fruits.pop()Do the following for this task: 1. Read through the following tutorial carefully: httos.docs.python.org3/tutorial/datastructures.html 2. While reading, transcribe every code example and make sure every statement works in your notebook. ENTER ALL CODE STARTING IN THE CELL BELOW YOU MUST USE ONE CELL FOR EACH CODE SNIPPED THAT RETURNS AN OUTPUT IN EACH EXERCISE THE FIRST EXERCISE HAS BEEN PASTED BELOW TO GET YOU STARTED In [ 1: >> truits'orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana'] In >>> fruits.count [ 'tangerine ') In>fruits.index( 'banaa In [ ]: >>> fruits. index('banana", 4) # Find next banana starting a position 4 In:>fruits.reverse i) In: >> fruita.append'grape) In fruits.sort In [ ?: >>> frusts.pop() fruits.countl 'apple s fruits 3s> truits fruits
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