11 Replies - 483 Views - Last Post: 10 November 2019 - 01:51 PM Rate Topic: -----

#1 kam536   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 21-March 18

Creating lists

Posted 07 November 2019 - 10:20 PM

allows a user to display, sort and update as needed a List of U.S States
containing the State Capital and State Bird. The Internet provides multiple references with these lists.
For example:
https://www.crestcap...es_and_capitals
http://www.thewebmap.com/FiftyStates/

You will need to embed the State data into your Python code. The user interface will allow the user to
perform the following functions:
1. Display all U.S. States in Alphabetical order along with
Capital and Flower
2. Search for a specific state and display the appropriate
Capital and Bird
3. Update a Bird for a specific state
4. Exit the program
2
As before, generate an appropriate Welcome, prompt, and exit messages to help the user navigate the
program.
The program should continue to allow selections until the program is exited.
If a state is not found an appropriate message should be displayed.
Hints:
1. Use the List data structure and associated sort() and searching capabilities
2. Create and use functions as often as possible
3. Use comments to document your code


My question is how do you make a list that includes all this information and then searches for specific information?

I am not asking for the code, I just am really confused. I am new to python and the information provided doesn't really explain lists. Would I have to physically go through and make all if statements throughout or what?

Is This A Good Question/Topic? 0
  • +

Replies To: Creating lists

#2 DK3250   User is offline

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,785
  • Joined: 27-December 13

Re: Creating lists

Posted 08 November 2019 - 08:26 AM

Are you familiar with the concept 'list of lists' ?
This means that the individual item in a list can be another list.

To sort a list of lists according to a specific index in the inner lists you can use:
items.sort(key = lambda x: x[1])
Here the outer list is called 'items' and is sorted according to the second value in the inner lists (index number 1).

I hope this will help.

EDIT:
Re-reading the assignment, I see that only sorting after first list item is requested; this is accomplished simply by: items.sort()

This post has been edited by DK3250: 08 November 2019 - 01:43 PM

Was This Post Helpful? 0
  • +
  • -

#3 kam536   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 21-March 18

Re: Creating lists

Posted 10 November 2019 - 01:03 AM

allows a user to display, sort and update as needed a List of U.S States
containing the State Capital and State Bird. The Internet provides multiple references with these lists.
For example:
https://www.crestcap...es_and_capitals
http://www.thewebmap.com/FiftyStates/
You will need to embed the State data into your Python code. The user interface will allow the user to
perform the following functions:
1. Display all U.S. States in Alphabetical order along with
Capital and Flower
2. Search for a specific state and display the appropriate
Capital and Bird
3. Update a Bird for a specific state
4. Exit the program
2
As before, generate an appropriate Welcome, prompt, and exit messages to help the user navigate the
program.
The program should continue to allow selections until the program is exited.
If a state is not found an appropriate message should be displayed.
Hints:
1. Use the List data structure and associated sort() and searching capabilities
2. Create and use functions as often as possible
3. Use comments to document your code




print("Hello,\n")
print("Welcome to the Python State Capital and \
Birds List Application")


def Menu():
    print("\nPlease make a selection from the choices below:\n")
    print("1.Display all the U.S. States in Alphabetical\
order along with Capitols and Flower")
    print("2.Search for a specific state and display the\
appropriate Capitol and Bird")
    print("3.Update a Bird for a specific state")
    print("4.Exit the program")
    
    Selection=int(input("What is your Selection?: "))
    return int(Selection)


s=[["Alabama","Montgomery","Camellia","Yellowhammer"],["Alaska","Juneau",\
"Forget-Me-Not","Williow Ptarmigan"],["Arizona","Phoenix","Suguaro \
Catus Blossom","Catus Wren"],["Arkansas","Little Rock","Apple Blossom",\
"Mocking Bird"],["California","Sacremento","Golden Poppy","California Valley\
Quail"],["Colorado","Denver","Mountain Columbine","Lark Bunting"],\
["Connecticut","Hartford","Mountain Laurel","Robin"],["Florida","Tallahassee",\
"Orange Blossom"],["Georgia","Atlanta","Cherokee Rose","Brown Thrasher"],\
["Hawaii","Honolulu","Red Hibiscus","Nene-Hawaiin Goose"],["Idaho","Boise",\
"Syringa","Mountain Bluebird"],["Illinois","Springfield","Violet","Cardinal"],\
["Indiana","Indianaplois","Peony","Cardinal"],["Iowa","Des Moines","Wild Rose",\
"Eastern Goldfinch"],["Kansas","Topeka","Sunflower","Western Meadowlark"],\
["Kentucky","Frankfort","Goldenrod","Cardinal"],["Louisiana","Baton Rouge",\
"Magnolia","Eastern Brown Pelican"],["Maine","Augusta","Pine Cone & Tassel",\
"Chickadee"],["Tennessee","Nashville","Iris","Mocking Bird"],["Maryland",\
"Annapolis","Black-eyed Susan","Baltimore Oriole"],["Deleware","Dover",\
"Peach Blossom","Blue Hen Chicken"],["Massachusettes","Boston","Mayflower",\
"Chickadee"],["Rhode Island","Providence","Violet","Rhode Island Red"],\
["Minniesota","St.Paul","Lady-Slipper","Loon"],["Mississippi","Jackson",\
"Magnolia","Mocking Bird"],["Missouri","Jefferson City","Hawthorne","Bluebird"\
],["Michigan","Lansing","Apple Blossom","Robin"],["Montana","Helena",\
"Bitterroot","Western Meadowlark"],["Nebraska","Lincoln","Goldenrod",\
"Western Meadowlark"],["Nevada","Carson City","Sagebrush","Mountain Bluebird"],\
["New Hampshire","Concord","Purple Lilac","Purple Finch"],["Vermont",\
"Montpelier","Red Clover","Herit Thrush"],["New Jersey","Trenton","Violet",\
"Eastern Goldfinch"],["New Mexico","Santa Fe","Yucca","Road Runner"],\
["New York","Albany","Rose","Bluebird"],["North Carolina","Raleigh",\
"Flowering Dogwood","Cardinal"],["Wyoming","Cheyenne","Indian Paintbrush",\
"Meadowlark"],["North Dakota","Bismark","Prairie Rose","Meadowlark"],\
["Ohio","Columbus","Scalet Carnation","Cardinal"],["Oklahoma","Oklahoma City",\
"Mistletoe","Scissor-tailed Flycatcher"],["Oregon","Salem","Oregon Grape",\
"Western Meadowlark"],["Pennsylvania","Harrisburg","Mountain Laurel",\
"Ruffed Grouse"],["South Carolina","Columbia","Yellow Jessamine",\
"Carolina Wren"],["South Dakota","Pierre","Pasqueflower","Ring-necked\
Pheasant"],["Texas","Austin","Bluebonnet","Mocking Bird"],["Utah","Salt Lake\
City"],["Virginia","Richmond","Dogwood","Cardinal"],["Washington","Olympia"\
"Coast Rhododendron","Willow Goldfinch"],["West Virginia","Charleston",\
"Rhododendron","Cardinal"],["Wisconsin","Madison","Wood Violet","Robin"]]





while True:
    Selection=Menu()
    if Selection == 1: 
        s.sort(key=lambda x: x[0])
        print(s)
    
    elif Selection == 2:
        
        
    elif Selection == 3:
        
        
    elif Selection == 4:
        print("\nThank-you for trying the Python State Capital and\
        Bird List Application!")
        break
    else:
        print("Not a valid entry!\n Please Enter a valid Entry\n")
        
    
    




I am unsure of how to perform a search and how to update the list.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15355
  • View blog
  • Posts: 61,551
  • Joined: 12-June 08

Re: Creating lists

Posted 10 November 2019 - 01:08 AM

Merging duplicates.
Was This Post Helpful? 0
  • +
  • -

#5 DK3250   User is offline

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,785
  • Joined: 27-December 13

Re: Creating lists

Posted 10 November 2019 - 02:57 AM

First, some python conventions:
In python it is best practice to name variables and functions using lowercase starting letters, so menu - not Menu and selection - not Selection.
Also, always place a space before and after operators (+, -, *, /, =, ...); e.g. your line 15 becomes: selection = int(input("What is your Selection?: "))
Use meaningful names; a list named 's' is not helpful - maybe rename to 'state_data' or similar.

In line 64 you sort after first entry in the inner lists; this can be accomplished simply by state_data.sort(), key index zero is default. But if you wanted the list sorted after bird name, you would need the expanded sort form.

Now, if selection == 2, you will need to ask the user one more question like "What state are you looking for?"; you will also need an error message if the state name does not exist (misspellings occurs). Finally you need to look-up the data. All this I would place in a separate function.

Similar for selection == 3.

Give it a try - you are welcome back here if required, but you need to show a decent attempt...
Was This Post Helpful? 0
  • +
  • -

#6 kam536   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 21-March 18

Re: Creating lists

Posted 10 November 2019 - 09:18 AM

View PostDK3250, on 10 November 2019 - 02:57 AM, said:

First, some python conventions:
In python it is best practice to name variables and functions using lowercase starting letters, so menu - not Menu and selection - not Selection.
Also, always place a space before and after operators (+, -, *, /, =, ...); e.g. your line 15 becomes: selection = int(input("What is your Selection?: "))
Use meaningful names; a list named 's' is not helpful - maybe rename to 'state_data' or similar.

In line 64 you sort after first entry in the inner lists; this can be accomplished simply by state_data.sort(), key index zero is default. But if you wanted the list sorted after bird name, you would need the expanded sort form.

Now, if selection == 2, you will need to ask the user one more question like "What state are you looking for?"; you will also need an error message if the state name does not exist (misspellings occurs). Finally you need to look-up the data. All this I would place in a separate function.

Similar for selection == 3.

Give it a try - you are welcome back here if required, but you need to show a decent attempt...



print("Hello,\n")
print("Welcome to the Python State Capital and \
Birds List Application")


def menu():
    print("\nPlease make a selection from the choices below:\n")
    print("1.Display all the U.S. States in Alphabetical\
order along with Capitols and Flower")
    print("2.Search for a specific state and display the\
appropriate Capitol and Bird")
    print("3.Update a Bird for a specific state")
    print("4.Exit the program")
    
    selection=int(input("What is your Selection?: "))
    return int(Selection)


stateData=[["Alabama","Montgomery","Camellia","Yellowhammer"],["Alaska","Juneau",\
"Forget-Me-Not","Williow Ptarmigan"],["Arizona","Phoenix","Suguaro \
Catus Blossom","Catus Wren"],["Arkansas","Little Rock","Apple Blossom",\
"Mocking Bird"],["California","Sacremento","Golden Poppy","California Valley\
Quail"],["Colorado","Denver","Mountain Columbine","Lark Bunting"],\
["Connecticut","Hartford","Mountain Laurel","Robin"],["Florida","Tallahassee",\
"Orange Blossom"],["Georgia","Atlanta","Cherokee Rose","Brown Thrasher"],\
["Hawaii","Honolulu","Red Hibiscus","Nene-Hawaiin Goose"],["Idaho","Boise",\
"Syringa","Mountain Bluebird"],["Illinois","Springfield","Violet","Cardinal"],\
["Indiana","Indianaplois","Peony","Cardinal"],["Iowa","Des Moines","Wild Rose",\
"Eastern Goldfinch"],["Kansas","Topeka","Sunflower","Western Meadowlark"],\
["Kentucky","Frankfort","Goldenrod","Cardinal"],["Louisiana","Baton Rouge",\
"Magnolia","Eastern Brown Pelican"],["Maine","Augusta","Pine Cone & Tassel",\
"Chickadee"],["Tennessee","Nashville","Iris","Mocking Bird"],["Maryland",\
"Annapolis","Black-eyed Susan","Baltimore Oriole"],["Deleware","Dover",\
"Peach Blossom","Blue Hen Chicken"],["Massachusettes","Boston","Mayflower",\
"Chickadee"],["Rhode Island","Providence","Violet","Rhode Island Red"],\
["Minniesota","St.Paul","Lady-Slipper","Loon"],["Mississippi","Jackson",\
"Magnolia","Mocking Bird"],["Missouri","Jefferson City","Hawthorne","Bluebird"\
],["Michigan","Lansing","Apple Blossom","Robin"],["Montana","Helena",\
"Bitterroot","Western Meadowlark"],["Nebraska","Lincoln","Goldenrod",\
"Western Meadowlark"],["Nevada","Carson City","Sagebrush","Mountain Bluebird"],\
["New Hampshire","Concord","Purple Lilac","Purple Finch"],["Vermont",\
"Montpelier","Red Clover","Herit Thrush"],["New Jersey","Trenton","Violet",\
"Eastern Goldfinch"],["New Mexico","Santa Fe","Yucca","Road Runner"],\
["New York","Albany","Rose","Bluebird"],["North Carolina","Raleigh",\
"Flowering Dogwood","Cardinal"],["Wyoming","Cheyenne","Indian Paintbrush",\
"Meadowlark"],["North Dakota","Bismark","Prairie Rose","Meadowlark"],\
["Ohio","Columbus","Scalet Carnation","Cardinal"],["Oklahoma","Oklahoma City",\
"Mistletoe","Scissor-tailed Flycatcher"],["Oregon","Salem","Oregon Grape",\
"Western Meadowlark"],["Pennsylvania","Harrisburg","Mountain Laurel",\
"Ruffed Grouse"],["South Carolina","Columbia","Yellow Jessamine",\
"Carolina Wren"],["South Dakota","Pierre","Pasqueflower","Ring-necked\
Pheasant"],["Texas","Austin","Bluebonnet","Mocking Bird"],["Utah","Salt Lake\
City"],["Virginia","Richmond","Dogwood","Cardinal"],["Washington","Olympia"\
"Coast Rhododendron","Willow Goldfinch"],["West Virginia","Charleston",\
"Rhododendron","Cardinal"],["Wisconsin","Madison","Wood Violet","Robin"]]


def searchState(stateData,state):
    dataFound=False
    for state In stateData:
      dataFound=True
      print("State Name: ", stateData.stateName,"Capital:",\
      stateData.capital,"Bird: ",stateData.bird)
    if dataFound = False:
        print("Invalid Entry")



def updateBird(stateData,stateName,birdName):
    for state In stateData:
        If state.stateName == stateName:
            state.updateBird(birdName)


while True:
    selection=menu()
    if selection == 1: 
        s.sort(key=lambda x: x[0])
        print(s)
    
    elif Selection == 2:
        stateName=input("What State are you searching for?: ")
        searchState(stateData,state)
        
    elif Selection == 3:
        stateName=input("What is the State name?: ")
        stateBird=input("What are you updating the Bird name to?: ")
        updateBird(stateData,stateName,birdName)
        
        
    elif Selection == 4:
        print("\nThank-you for trying the Python State Capital and\
        Bird List Application!")
        break
    else:
        print("Not a valid entry!\n Please Enter a valid Entry\n")
        
    
    




Here is my attempt.
This is my error code:
File "/home/ec2-user/environment/Project3/Python State Capital and Bird List Application Code1.py", line 67
for state In stateData:
^
SyntaxError: invalid syntax
Was This Post Helpful? 0
  • +
  • -

#7 DK3250   User is offline

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,785
  • Joined: 27-December 13

Re: Creating lists

Posted 10 November 2019 - 09:34 AM

Yes, clearly there is an error in that line:
for state In stateData:

You should be able to see it yourself (only 4 words, one is bad).

Oh, and a similar error in line 70/71

This post has been edited by DK3250: 10 November 2019 - 09:35 AM
Reason for edit:: addendum

Was This Post Helpful? 0
  • +
  • -

#8 kam536   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 21-March 18

Re: Creating lists

Posted 10 November 2019 - 09:49 AM

View PostDK3250, on 10 November 2019 - 09:34 AM, said:

Yes, clearly there is an error in that line:
for state In stateData:

You should be able to see it yourself (only 4 words, one is bad).

Oh, and a similar error in line 70/71



#Displays greeting
print("Hello,\n")
print("Welcome to the Python State Capital and \
Birds List Application")

#Displays Menu
def menu():
    print("\nPlease make a selection from the choices below:\n")
    print("1.Display all the U.S. States in Alphabetical\
order along with Capitols and Flower")
    print("2.Search for a specific state and display the\
appropriate Capitol and Bird")
    print("3.Update a Bird for a specific state")
    print("4.Exit the program")
    
    selection=int(input("What is your Selection?: "))
    return int(selection)

#Creates a Mulitdimensional list for state and attributes
stateData=[["Alabama","Montgomery","Camellia","Yellowhammer"],["Alaska",\
"Juneau","Forget-Me-Not","Williow Ptarmigan"],["Arizona","Phoenix","Suguaro \
Catus Blossom","Catus Wren"],["Arkansas","Little Rock","Apple Blossom",\
"Mocking Bird"],["California","Sacremento","Golden Poppy","California Valley\
Quail"],["Colorado","Denver","Mountain Columbine","Lark Bunting"],\
["Connecticut","Hartford","Mountain Laurel","Robin"],["Florida","Tallahassee",\
"Orange Blossom"],["Georgia","Atlanta","Cherokee Rose","Brown Thrasher"],\
["Hawaii","Honolulu","Red Hibiscus","Nene-Hawaiin Goose"],["Idaho","Boise",\
"Syringa","Mountain Bluebird"],["Illinois","Springfield","Violet","Cardinal"],\
["Indiana","Indianaplois","Peony","Cardinal"],["Iowa","Des Moines","Wild Rose",\
"Eastern Goldfinch"],["Kansas","Topeka","Sunflower","Western Meadowlark"],\
["Kentucky","Frankfort","Goldenrod","Cardinal"],["Louisiana","Baton Rouge",\
"Magnolia","Eastern Brown Pelican"],["Maine","Augusta","Pine Cone & Tassel",\
"Chickadee"],["Tennessee","Nashville","Iris","Mocking Bird"],["Maryland",\
"Annapolis","Black-eyed Susan","Baltimore Oriole"],["Deleware","Dover",\
"Peach Blossom","Blue Hen Chicken"],["Massachusettes","Boston","Mayflower",\
"Chickadee"],["Rhode Island","Providence","Violet","Rhode Island Red"],\
["Minniesota","St.Paul","Lady-Slipper","Loon"],["Mississippi","Jackson",\
"Magnolia","Mocking Bird"],["Missouri","Jefferson City","Hawthorne","Bluebird"\
],["Michigan","Lansing","Apple Blossom","Robin"],["Montana","Helena",\
"Bitterroot","Western Meadowlark"],["Nebraska","Lincoln","Goldenrod",\
"Western Meadowlark"],["Nevada","Carson City","Sagebrush","Mountain Bluebird"],\
["New Hampshire","Concord","Purple Lilac","Purple Finch"],["Vermont",\
"Montpelier","Red Clover","Herit Thrush"],["New Jersey","Trenton","Violet",\
"Eastern Goldfinch"],["New Mexico","Santa Fe","Yucca","Road Runner"],\
["New York","Albany","Rose","Bluebird"],["North Carolina","Raleigh",\
"Flowering Dogwood","Cardinal"],["Wyoming","Cheyenne","Indian Paintbrush",\
"Meadowlark"],["North Dakota","Bismark","Prairie Rose","Meadowlark"],\
["Ohio","Columbus","Scalet Carnation","Cardinal"],["Oklahoma","Oklahoma City",\
"Mistletoe","Scissor-tailed Flycatcher"],["Oregon","Salem","Oregon Grape",\
"Western Meadowlark"],["Pennsylvania","Harrisburg","Mountain Laurel",\
"Ruffed Grouse"],["South Carolina","Columbia","Yellow Jessamine",\
"Carolina Wren"],["South Dakota","Pierre","Pasqueflower","Ring-necked\
Pheasant"],["Texas","Austin","Bluebonnet","Mocking Bird"],["Utah","Salt Lake\
City"],["Virginia","Richmond","Dogwood","Cardinal"],["Washington","Olympia"\
"Coast Rhododendron","Willow Goldfinch"],["West Virginia","Charleston",\
"Rhododendron","Cardinal"],["Wisconsin","Madison","Wood Violet","Robin"]]

#Searches for state entered
def searchState(stateData,stateName):
    dataFound=False
    for state in stateData:
      dataFound=True
      print("State Name: ", stateData.stateName,"Capital:",\
      stateData.capital,"Bird: ",stateData.bird)
    else: 
        print("Invalid Entry")


#Updates Bird in the list
def updateBird(stateData,stateName,stateBird):
    for state in stateData:
        if state.stateName == stateName:
            state.updateBird(stateBird)

#Determines what to do based on users prompt
while True:
    selection=menu()
    if selection == 1: 
        stateData.sort(key=lambda x: x[0])
        print(stateData)
    
    elif selection == 2:
        stateName=input("What State are you searching for?: ")
        searchState(stateData,stateName)
        
    elif selection == 3:
        stateName=input("What is the State name?: ")
        stateBird=input("What are you updating the Bird name to?: ")
        updateBird(stateData,stateName,stateBird)
        
        
    elif selection == 4:
        print("\nThank-you for trying the Python State Capital and\
        Bird List Application!")
        break
    
    else:
        print("Not a valid entry!\n Please Enter a valid Entry\n")
        
    
    




Error:

Traceback (most recent call last):
File "/home/ec2-user/environment/Project3/Python State Capital and Bird List Application Code1.py", line 90, in <module>
searchState(stateData,stateName)
File "/home/ec2-user/environment/Project3/Python State Capital and Bird List Application Code1.py", line 69, in searchState
print("State Name: ", stateData.stateName,"Capital:",\
AttributeError: 'list' object has no attribute 'stateName'
Was This Post Helpful? 0
  • +
  • -

#9 DK3250   User is offline

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,785
  • Joined: 27-December 13

Re: Creating lists

Posted 10 November 2019 - 11:21 AM

ok, you get an error.
Do you understand this error?
If you understand the error you might also have an idea about how to correct it?
Was This Post Helpful? 0
  • +
  • -

#10 kam536   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 21-March 18

Re: Creating lists

Posted 10 November 2019 - 12:17 PM

View PostDK3250, on 10 November 2019 - 11:21 AM, said:

ok, you get an error.
Do you understand this error?
If you understand the error you might also have an idea about how to correct it?




I know that the "states" name is incorrect but how do you search by the first index in a multiple dimensional list? Then print it out?
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15355
  • View blog
  • Posts: 61,551
  • Joined: 12-June 08

Re: Creating lists

Posted 10 November 2019 - 01:18 PM

There are many ways to navigate a list. By indexes, by objects, etc.

Ex:

arr = []
print(arr) #empty

print()


i = 0

#fill with a value
for r in range(0,4):
    inner = []
    for c in range(0,4):
        inner.append(i)
        i+=1
    arr.append(inner)

#print out list
for row in arr: 
    print(row) 

print()
#print out single indexed element in the list
print(arr[0][1])

#search for an element in the list.
for row in arr:
    for col in row:
        if col == 5:
            print('found!')
        else:
            print('not found')
#search for value in the list with indexes
for r in range(0,4):
    for c in range(0,4):
        if arr[r][c] == 8:
            print('found!')
        else:
            print('not found')


Was This Post Helpful? 0
  • +
  • -

#12 DK3250   User is offline

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,785
  • Joined: 27-December 13

Re: Creating lists

Posted 10 November 2019 - 01:51 PM

Further to modi123_1's input:

The list called 'stateData' contains list of 'stateInfo' (just a name I have made up).
So iterating through 'stateData' will give you:
for stateInfo in stateData:
    #stateInfo is now one of the individual lists, where 'name' (state name) is in first position
    name = stateInfo[0]

    # now you need to do the comparison
    if stateName == name:
        # do whatever you need here



All this can be compressed a little:
for stateInfo in stateData:
    if stateName == stateInfo[0]:
        # do whatever you need here

Here the intermediate variable 'name' is omitted - but the code works exactly the same as in the first example.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1