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}
Answer:
If the following answer is helpful please mark as brainliest. This is the answer:
Explanation:
print("What is your name?")
name=input()
print("And where do you live", name)
location=input()
print("I've never been to", location)
Answer:
A
Explanation:
B is a print statement.
C is a function invocation
D is a function declaration
A prototype is actually quite close to a declaration. The semi-colon at the end shows that no implementation will follow. Adding parameter names is allowed but would only be helpful for better understanding.
Answer: Hello your required question is wrong as it does not tally with the data provided , attached below is the complete question
answer:
/23 /26 /27 /28 option A
Explanation:
<u>Breakdown of the last four subnet masks given to the subnets </u>
For the subnet of 500 production host the mask = /23 which will produce 512 hosts
For the subnet of 60 sales host the mask = /26 which will produce 64 hosts
For the subnet of 12 host the mask = /27 which will produce 32 hosts
For the subnet of 30 hosts the mask = /28 which will produce 16 hosts
Mmm what are u talking abouy