logo

Crowdly

Browser

Add to Chrome

Programación 1B (Rojero LMiV)

Looking for Programación 1B (Rojero LMiV) test answers and solutions? Browse our comprehensive collection of verified answers for Programación 1B (Rojero LMiV) at moodle.ulsachihuahua.edu.mx.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?

a) [3, 4, 5, 20, 5, 25, 1]

b) [1, 3, 3, 4, 5, 5, 20, 25]

c) [3, 5, 20, 5, 25, 1, 3]

d) [1, 3, 4, 5, 20, 5, 25]

View this question

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?

a) Error

b) None

c) 25

d) 2

View this question

What will be the output after running the following code?

def func(mylist):

    mylist[3]="strawberries"

lst = ["bananas","apples","pears","peas"]

func(lst)

print(lst)

A. ['bananas', 'apples', 'strawberries', 'peas']

B. ['bananas', 'apples', 'pears', 'strawberries']

C. ['bananas', 'apples', 'strawberries']

D. ['strawberries', 'strawberries', 'strawberries']

View this question

What would be the output of the below code?

fruits = ["Robert","Karamagi", ""]

fruits.remove("Robert")

print(fruits)

A. Robert

B. ['Karamagi', '']

C. ["Robert","Karamagi"]

D. ["Robert"]

View this question

What does the following code print to the console.

bases = ["first", "second", "third", "fourth"]

bases.remove("fourth")

print(bases)

A. ['first', 'second', 'third']

B. ['first']

C. ['first', 'second']

D. ["second", "third", "fourth"]

View this question

Which type of elements are accepted by random.shuffle()?

a) strings

b) lists

c) tuples

d) integers

View this question

What will be the output of the following Python code?

x = ['ab', 'cd']

for i in x:

    i.upper()

print(x)

a) [‘ab’, ‘cd’]

b) [‘AB’, ‘CD’]

c) [None, None]

d) none of the mentioned

View this question

What will be the output of the following Python code?

def increment_items(L, increment):

    i = 0

    while i < len(L):

        L[i] = L[i] + increment

        i = i + 1

 

values = [1, 2, 3]

print(increment_items(values, 2))

print(values)

a)

   None

   [3, 4, 5]

b)

   None

   [1, 2, 3]

c)

   [3, 4, 5]

   [1, 2, 3]

d)

   [3, 4, 5]

   None

View this question

What will the output be after executing the following code?

fruits = ["apples","bananas"]

for i in range(1,2):

    for fruit in fruits:

        print(i, fruit)

A.

apples

bananas

B. error

C.

1 apples

1 bananas

D.

1 apples

2 bananas

View this question

What does the following code print to the console.

letters = ["b", "a", "y", "a"]

index = letters.index("a")

print(index)

A. 2

B. 1

C. 0

D. 3

View this question

Want instant access to all verified answers on moodle.ulsachihuahua.edu.mx?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome