Using the tuple, birds = ('peacock', 'parrot', 'owl', 'sparrow'), determine the position of 'owl'., print(birds.index('owl')), print(birds.count('owl')), Write the code to access the third bird in the tuple., print(birds[2]), print(birds[3]), Write the code to display the second and third birds in the tuple., print(birds[2:3]), print(birds[1:3]), Write the code to display the last two birds in reverse order using negative indexing., print(birds[-1:-3:-1]), print(birds[-1:-3]), Write the code to reverse the entire tuple., print(birds[-1::-1]), print(birds[-1:-1]), Assume the tuple is ('peacock', 'parrot', 'owl', 'parrot', 'sparrow'). Write the code to count the occurrences of 'parrot'., print(birds.index('parrot')), print(birds.count('parrot')), Write the code to check whether 'parrot' is present in the tuple., print('parrot' with birds), print('parrot' in birds), The wildlife department wants to know the total number of birds., print(len(birds)), print(count(birds)), The wildlife department wants to know whether eagle is present in the list of birds., print('eagle' in birds), print(birds['eagle']), Find the position of 'sparrow' in the tuple., print(birds.index('sparrow')), print(birds.count('sparrow'))
0%
Tuple Operations
Udostępnij
Udostępnij
autor:
Beulahchristuda
Edytuj elementy
Drukuj
Osadź
Więcej
Zadania
Tabela rankingowa
Pokaż więcej
Pokaż mniej
Ta tabela rankingowa jest obecnie prywatna. Kliknij przycisk
Udostępnij
, aby ją upublicznić.
Ta tabela rankingowa została wyłączona przez właściciela materiału.
Ta tabela rankingowa została wyłączona, ponieważ Twoje opcje różnią się od opcji właściciela materiału.
Przywróć poprzednie opcje
Koło fortuny
jest szablonem otwartym. Nie generuje wyników w tabeli rankingowej.
Wymagane logowanie
Motyw
Czcionki
Wymagany abonament
Opcje
Zmień szablon
Pokaż wszystko
Otwórz wyniki
Kopiuj link
Kod QR
Usuń
Przywrócić automatycznie zapisane ćwiczenie:
?