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]
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
a) Errorb) Nonec) 25d) 2
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']
What would be the output of the below code?
fruits = ["Robert","Karamagi", ""]fruits.remove("Robert")print(fruits)
A. RobertB. ['Karamagi', '']C. ["Robert","Karamagi"]D. ["Robert"]
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"]
Which type of elements are accepted by random.shuffle()?
a) stringsb) listsc) tuplesd) integers
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
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
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.applesbananas
B. error
C.1 apples1 bananas
D.1 apples2 bananas
What does the following code print to the console.
letters = ["b", "a", "y", "a"]index = letters.index("a")print(index)
A. 2B. 1C. 0D. 3