Answer:
- letter_counts = {}
- string1 = "I have a dream"
-
- string1 = string1.lower()
-
- for x in string1:
- if(x == " "):
- continue
- if x not in letter_counts:
- letter_counts[x] = 1
- else:
- letter_counts[x] += 1
-
- print(letter_counts)
Explanation:
The solution is written in Python 3.
Firstly create a letter_count dictionary (Line 1)
Next, create a sample string and assign it to string1 variable and convert all the characters to lowercase using lower method (Line 4).
Create a for loop to traverse through each character in string1 and check if the current character is a single space, just skip to the next iteration (Line 7 -8). If the current character is not found in letter_counts dictionary, set the initial count value 1 to x property of letter_counts. Otherwise increment the x property value by one (Line 9 -12).
After completion of loop, print the letter_count dictionary. We shall get the sample output {'i': 1, 'h': 1, 'a': 3, 'v': 1, 'e': 2, 'd': 1, 'r': 1, 'm': 1}
How did you see this then?
Answer:
An atom consists of two basic parts: the nucleus and the electrons. The nucleus is the central core of an atom and is made up of protons and neutrons. Electrons are very light, negatively charged particles that surround the positively charged nucleus. Early models of the atom depicted the electrons circling the nucleus in fixed orbits, much like planets revolving around the sun.
Current theory suggests that electrons are housed in orbitals. This is a valence orbital or valence orbit
Explanation:
The outermost orbital shell of an atom is called its valence shell, and the electrons in the valence shell are valence electrons. Valence electrons are the highest energy electrons in an atom and are therefore the most reactive. this is where your valence orbit gets its name because it is the outermost shell.
The answer is Document Inspector
you can get tax identification number, open a bank account and do business all under its own name