Ask a Question

Test complete Desktop Application Python - Not able to append elements to a list

SOLVED
nikhiltadi
New Contributor

Test complete Desktop Application Python - Not able to append elements to a list

Hi Team,

I'm using test complete for desktop automation using python programming language. Suppose, just say there is a elements which needed to be added into list.

When i try append elements into a list and then try to print it.It is returning empty.

 

#sample code

def main():

     list = []

     element = "apple"

     list.append(element)

     print(list)

 

Expected Output:

 ['apple']

 

Actual Output:

 empty

 

Note:

Same is the case when on using insert,append,add

1 REPLY 1
rraghvani
Trusted Contributor

See Python - Specifics of Usage

 

Code

def main():
    list = []
    element = "apple"
    list.append(element)
    Log.Message(list[0])

 

cancel
Showing results for 
Search instead for 
Did you mean: