Computer Science, asked by Anonymous, 11 months ago

Write the output of the given Python code.

# !/user/bin/python
list1 = [‘physics’, ‘chemistry’, 1997, 2000];
list2 = [1,2,3,4,5,6, 7];
print “list1[0]”, list1[0]
.

Answers

Answered by ıtʑFᴇᴇʟɓᴇãᴛ
2

Write the output of the given Python code :

#!/user/bin/python

list1, list2 = [123, ‘xyz’], [456, ‘abc’]

print cmpt(list1, list2);

print cmp(list2, list1);

list3 = list2 + [786];

print cmp(list2, list3)

Answer:

This will produce the following result:

-1

1

-1

Answered by Anonymous
1

Write the output of the given Python code :

#!/user/bin/python

list1, list2 = [123, ‘xyz’], [456, ‘abc’]

print cmpt(list1, list2);

print cmp(list2, list1);

list3 = list2 + [786];

print cmp(list2, list3)

Answer:

This will produce the following result:

-1

1

-1

..hope you have a good time p.........

Similar questions