SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
A) Using a for loop, write a snippet of code that takes a word as input and outputs how many
times the letter A appears in that input.
Ex. Input: Cabbage Output: There are 2 As. (Hints: Make sure your grammar is correct for the
different possible outputs. Be sure to count capital and lowercase As.)
B). Using your code from the previous question, modify the code to also print the index in which
each A is found. Ex. Input: Cabbage Output: A -> 1 A -> 4 There are 2 As.

Contenu connexe

Plus de alekhyajewellers

Accessing Specialty Care for Community Health Center Patients � Case.pdf
Accessing Specialty Care for Community Health Center Patients � Case.pdfAccessing Specialty Care for Community Health Center Patients � Case.pdf
Accessing Specialty Care for Community Health Center Patients � Case.pdf
alekhyajewellers
 
ABSTRACT In periods of economic downturn, government leaders try to.pdf
ABSTRACT In periods of economic downturn, government leaders try to.pdfABSTRACT In periods of economic downturn, government leaders try to.pdf
ABSTRACT In periods of economic downturn, government leaders try to.pdf
alekhyajewellers
 

Plus de alekhyajewellers (20)

Accessing Specialty Care for Community Health Center Patients � Case.pdf
Accessing Specialty Care for Community Health Center Patients � Case.pdfAccessing Specialty Care for Community Health Center Patients � Case.pdf
Accessing Specialty Care for Community Health Center Patients � Case.pdf
 
ABSTRACT In periods of economic downturn, government leaders try to.pdf
ABSTRACT In periods of economic downturn, government leaders try to.pdfABSTRACT In periods of economic downturn, government leaders try to.pdf
ABSTRACT In periods of economic downturn, government leaders try to.pdf
 
A) Briefly explain the difference between the common stock and a sen.pdf
A) Briefly explain the difference between the common stock and a sen.pdfA) Briefly explain the difference between the common stock and a sen.pdf
A) Briefly explain the difference between the common stock and a sen.pdf
 
Aadakilerin olduu bir ekonomi d��n�n bullet Marjinal tasarruf eil.pdf
Aadakilerin olduu bir ekonomi d��n�n bullet Marjinal tasarruf eil.pdfAadakilerin olduu bir ekonomi d��n�n bullet Marjinal tasarruf eil.pdf
Aadakilerin olduu bir ekonomi d��n�n bullet Marjinal tasarruf eil.pdf
 
Aadakilerin her birini ele alan 5-7 sayfalk bir makale yazn Yapay.pdf
Aadakilerin her birini ele alan 5-7 sayfalk bir makale yazn Yapay.pdfAadakilerin her birini ele alan 5-7 sayfalk bir makale yazn Yapay.pdf
Aadakilerin her birini ele alan 5-7 sayfalk bir makale yazn Yapay.pdf
 
Aadakilerin t�m�, Incotermsin rol� ile ilgili olarak dorudur a) .pdf
Aadakilerin t�m�, Incotermsin rol� ile ilgili olarak dorudur a) .pdfAadakilerin t�m�, Incotermsin rol� ile ilgili olarak dorudur a) .pdf
Aadakilerin t�m�, Incotermsin rol� ile ilgili olarak dorudur a) .pdf
 
Aadakileri anlamak i�in yardma ihtiyacnz var Bir hikaye yazarken ve.pdf
Aadakileri anlamak i�in yardma ihtiyacnz var Bir hikaye yazarken ve.pdfAadakileri anlamak i�in yardma ihtiyacnz var Bir hikaye yazarken ve.pdf
Aadakileri anlamak i�in yardma ihtiyacnz var Bir hikaye yazarken ve.pdf
 
A toddler was playing with a penny and accidentally swallowed it.pdf
A toddler was playing with a penny and accidentally swallowed it.pdfA toddler was playing with a penny and accidentally swallowed it.pdf
A toddler was playing with a penny and accidentally swallowed it.pdf
 
Aadakilerden hangisi sanal ekibin avantajlarndan biri deildir A) Ek.pdf
Aadakilerden hangisi sanal ekibin avantajlarndan biri deildir A) Ek.pdfAadakilerden hangisi sanal ekibin avantajlarndan biri deildir A) Ek.pdf
Aadakilerden hangisi sanal ekibin avantajlarndan biri deildir A) Ek.pdf
 
Aadakilerden hangisi M-Mnin m�kemmel sermaye piyasas varsaymlarndan.pdf
Aadakilerden hangisi M-Mnin m�kemmel sermaye piyasas varsaymlarndan.pdfAadakilerden hangisi M-Mnin m�kemmel sermaye piyasas varsaymlarndan.pdf
Aadakilerden hangisi M-Mnin m�kemmel sermaye piyasas varsaymlarndan.pdf
 
Aadakilerden hangisi JIT felsefesinin �zelliklerinden biridir �ok.pdf
Aadakilerden hangisi JIT felsefesinin �zelliklerinden biridir �ok.pdfAadakilerden hangisi JIT felsefesinin �zelliklerinden biridir �ok.pdf
Aadakilerden hangisi JIT felsefesinin �zelliklerinden biridir �ok.pdf
 
Aadakilerden hangisi kalknmada bor� finansmanna bir �rnek DELDR �lk.pdf
Aadakilerden hangisi kalknmada bor� finansmanna bir �rnek DELDR �lk.pdfAadakilerden hangisi kalknmada bor� finansmanna bir �rnek DELDR �lk.pdf
Aadakilerden hangisi kalknmada bor� finansmanna bir �rnek DELDR �lk.pdf
 
Aadakilerden hangisi imtiyazl hisse senedinin �zelliklerinden biri d.pdf
Aadakilerden hangisi imtiyazl hisse senedinin �zelliklerinden biri d.pdfAadakilerden hangisi imtiyazl hisse senedinin �zelliklerinden biri d.pdf
Aadakilerden hangisi imtiyazl hisse senedinin �zelliklerinden biri d.pdf
 
Aadakilerden hangisi dehidrasyon reaksiyonu ile hidroliz arasndaki i.pdf
Aadakilerden hangisi dehidrasyon reaksiyonu ile hidroliz arasndaki i.pdfAadakilerden hangisi dehidrasyon reaksiyonu ile hidroliz arasndaki i.pdf
Aadakilerden hangisi dehidrasyon reaksiyonu ile hidroliz arasndaki i.pdf
 
Aadakilerden hangisi bir �alann iverene itaat etme ahlaki sorumluluu.pdf
Aadakilerden hangisi bir �alann iverene itaat etme ahlaki sorumluluu.pdfAadakilerden hangisi bir �alann iverene itaat etme ahlaki sorumluluu.pdf
Aadakilerden hangisi bir �alann iverene itaat etme ahlaki sorumluluu.pdf
 
Aadakilerden hangisi bir euroequity ihracnn �zelliklerinden biridir.pdf
Aadakilerden hangisi bir euroequity ihracnn �zelliklerinden biridir.pdfAadakilerden hangisi bir euroequity ihracnn �zelliklerinden biridir.pdf
Aadakilerden hangisi bir euroequity ihracnn �zelliklerinden biridir.pdf
 
Aadakilerden hangisi EN AZ yaygndr a) serbest ticaret b�lgeleri.pdf
Aadakilerden hangisi EN AZ yaygndr a) serbest ticaret b�lgeleri.pdfAadakilerden hangisi EN AZ yaygndr a) serbest ticaret b�lgeleri.pdf
Aadakilerden hangisi EN AZ yaygndr a) serbest ticaret b�lgeleri.pdf
 
Aadaki s�bjektif olaslk beyan i�in hatay veya yanll tanmlayn ve olas.pdf
Aadaki s�bjektif olaslk beyan i�in hatay veya yanll tanmlayn ve olas.pdfAadaki s�bjektif olaslk beyan i�in hatay veya yanll tanmlayn ve olas.pdf
Aadaki s�bjektif olaslk beyan i�in hatay veya yanll tanmlayn ve olas.pdf
 
Aadakilerden hangisi davalnn s�zlemeden ka�nmak i�in ileri s�rebilec.pdf
Aadakilerden hangisi davalnn s�zlemeden ka�nmak i�in ileri s�rebilec.pdfAadakilerden hangisi davalnn s�zlemeden ka�nmak i�in ileri s�rebilec.pdf
Aadakilerden hangisi davalnn s�zlemeden ka�nmak i�in ileri s�rebilec.pdf
 
a) Sabit bir deiim alanna (EMS � Avrupa Para Sistemi gibi) katlmann .pdf
a) Sabit bir deiim alanna (EMS � Avrupa Para Sistemi gibi) katlmann .pdfa) Sabit bir deiim alanna (EMS � Avrupa Para Sistemi gibi) katlmann .pdf
a) Sabit bir deiim alanna (EMS � Avrupa Para Sistemi gibi) katlmann .pdf
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Dernier (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

A) Using a for loop, write a snippet of code that takes a word as in.pdf

  • 1. A) Using a for loop, write a snippet of code that takes a word as input and outputs how many times the letter A appears in that input. Ex. Input: Cabbage Output: There are 2 As. (Hints: Make sure your grammar is correct for the different possible outputs. Be sure to count capital and lowercase As.) B). Using your code from the previous question, modify the code to also print the index in which each A is found. Ex. Input: Cabbage Output: A -> 1 A -> 4 There are 2 As.