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
Kongsikan
Kongsikan
oleh
Beulahchristuda
Edit Kandungan
Cetakan
Benamkan
Lebih lagi
Tugasan
Papan mata
Paparkan banyak
Paparkan sedikit
Papan mata ini berciri peribadi pada masa ini. Klik
Kongsikan
untuk menjadikannya umum.
Papan mata ini telah dilumpuhkan oleh pemilik sumber.
Papan mata ini dinyahdayakan kerana pilihan anda berbeza daripada pemilik sumber.
Pilihan untuk Kembali
Roda rawak
ialah templat terbuka. Ia tidak menjana skor untuk papan mata.
Log masuk diperlukan
Gaya visual
Fon
Langganan diperlukan
Pilihan
Tukar templat
Paparkan semua
Buka keputusan
Salin pautan
Kod QR
Padam
Pulihkan autosimpan:
?