First, we have to understand what scope is. When variables are declared, they are only available in the code block they're declared in, unless they're global variables (this doesn't apply here).
strFirst is declared in usernameMaker and that is the only place it is available in.
Answer:
Following are the correct code to this question:
short_names=['Gus','Bob','Zoe']#defining a list short_names that holds string value
print (short_names[0])#print list first element value
print (short_names[1])#print list second element value
print (short_names[2])#print list third element value
Output:
Gus
Bob
Zoe
Explanation:
- In the above python program code, a list "short_names" list is declared, that holds three variable that is "Gus, Bob, and Zoe".
- In the next step, the print method is used that prints list element value.
- In this program, we use the list, which is similar to an array, and both elements index value starting from the 0, that's why in this code we print "0,1, and 2" element value.
Willy Shakespeare has 17 characters. It's higher than 12,so the output will be Too long. Enter a name with fewer than 12 characters.
Letter a.
A file extension includes the three or four characters that follow the dot in the file name
A computer.
Core components of a computer
Processor (cpu): can compute instructions
RAM (random access memory): Holds running processes.
HDD( hard disk drive): Stores data, e.g. pictures, documents, games etc.
Motherboard: Allows devices to communicate with each other via a "bus".
Power Supply (PSU): converts AC current to DC, providing the computer with power.