Question:
Write one for loop to print out each element of the list several_things. Then, write another for loop to print out the TYPE of each element of the list several_things.
Answer:
The solution in python is as follows:
for element in several_things:
print(element)
for element in several_things:
print(type(element))
Explanation:
The solution assumes that the list several_things has already been initialized.
So, the rest of the code is explained as follows:
This line iterates through the list, several_things
for element in several_things:
This line prints each element
print(element)
This line iterates through the list, several_things for the second time
for element in several_things:
This line prints the type of each element
print(type(element))
Answer:
CTRL + F
Explanation:
usually CTRL + F but it would depend on the program
In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)
then, each time you find that charat, spc++.
also, the string must be declared in the main method, not the spaces count method.
The actual code:
public class CountSpaces{
public static void main(String[] args){
String instring = "(your quote here)";
int spaces = calculateSpaces(instring);
System.out.println("The number of spaces is " + spaces);
}
public static int calculateSpaces(String in){
int spc = 0;
for(int i= 0; i<in.length; i++){
if(in.charAt(i)== ' '){
spc++;
}
}
return spc;
}
}
that should be it. If you have any questions, feel free to reach out.
Answer:
c. developer
Explanation:
DEVELOPER TOOLS are tools that enables designers to easily and quickly edit web page and as well diagnosed issues or problem on a website which will inturn enables them to build a great and better websites without stress reason been that when a designer makes use of DEVELOPER TOOLS they can quicky track down and as well fix the problem that was diagnosed within a minute or seconds thereby saving time when developing a website profile.