Understanding Decision Structures in Programming
Understanding Decision Structures in Programming
flow?
User's response:
Rhombo
result
Correct!
Results of the question
It is a multiple decision instruction:
User's response:
Yes- No
Result:
Correct!
Results of the question
What is the instruction that completes the 'Repeat' structure?
User's response:
For
Result:
Correct!
Results of the question
What shape is used to represent operations in a flowchart?
User's response:
Rectangle
Result:
Correct!
Correct!
Results of the question
In a double decision instruction, how many possible options are there if the
Is the logical result false?
User's response:
1
Result:
Correct!
Results of the question
What shape is used to represent a decision point in a diagram?
flow?
User's response:
Rhombo
Result:
Correct!
Results of the question
In addition to FINPARA, what other instruction completes the 'Para' structure?
User's response:
Until
Result:
Correct!
Correct!
Level 2
LESSON 1
What logical value results from the following line of code? Result=True and
False and True
User's response:
No value
Result:
You need to reinforce the topic: Basic declarations and instructions of Python
Results of the question
What logical value results from the following line of code? Result=True and
False or True
User's response:
True
Result:
Correct!
Results of the question
Marcela needs to outline different paths in her solution, what characteristic
Should I apply to schedule?
User's response:
Selective
Result:
Correct!
Results of the question
What is the line of code to declare a range of values from 0 to 9?
User's response:
range(0,10)
Result:
Correct!
Results of the question
Mario writes lines of code to maintain an order of execution, what
Which programming feature applies?
User's response:
Sequential
Result:
Correct!
Results of the question
What is the correct code to change a boolean value?
User's response:
x=input('Enter a logical value') print not(x)
Result:
Correct!
Results of the question
In the following image, which is the IDE's toolbar?
User's response:
1
Result
Correct!
Results of the question
What is the correct way to print Hello world in the IDE?
User's response:
Hello world
Result:
You need to reinforce the topic: Integrated development environment for Python
Results of the question
Alejandra informs you that a process is iterative in your solution, what characteristic
Do you need to apply to schedule?
User's response:
Repetitive
Result:
Correct!
Results of the question
In the following image, which is the project bar of the IDE?
User response:
3
Result:
Correct!
LESSON 2
This is the correct way to access an element of a list within a
dictionary
User's response:
value = dictionary['Key'][1]
Resultado
Correct!
Results of the question
Results of the question
This is the correct way to access an element of a dictionary:
User's response:
Value = dictionary['Key1']
Resultado
Correct!
Results of the question
What is the output in the console of the following program?
cadena
for j in range(1,6):
for i in range(0,j):
chain = chain + str(j)
print(string)
User's response:
122333000000000
Result:
Correct!
Results of the question
What is the console output of the following program?
def alpha(number):
resultado = 0
for j in range(1,5):
result += number + 2
beta(result)
return final
def beta(number):
return number/2.0
print(alfa(2))
User's response:
8
Result:
Correct!
Results of the question
It is the correct way to call a function:
User's response:
name(variable)
Result:
Correct!
Results of the question
The instruction to access the element '$' of the following list lst = ["Jorge",
"Mario", ["Octavio", '$'], "Toti", '#'] is:
User's response:
lst[2][1]
Result:
Correct!
Results of the question
A _________ is a block of instructions that can be reused and is used for
organize a program:
User's response:
Function
result
Correct!
Results of the question
What does the following program print to the console if you input the number 3?
Enter a Number:
numeroStr = int(numeroInt)
if(numberInt > 2):
print(numeroStr + "1")
elif(numberInt == 2):
print(numeroStr + "2")
else:
print(numeroStr + "3")
User's response:
31
resultado
Correct!
Results of the question
It is a feature that differentiates tuples from lists:
User's response:
Once defined, their elements can change.
Result:
Correct!
Results of the question
It is a repetition structure that keeps repeating a block of code
while a condition is true.
User's response:
While
Resultado
Correct!
Results of the question
In the following code, a secondary decision is:
Correct!
Results of the question
Correct!
Results of the question
Decision structures typically evaluate data __________.
User's response:
Booleans
Result:
Correct!
LESSON 3 Results of the question
Which of the following options presents an example of the use of variables of
instance?
User's response:
Worker("Jorge")
Result:
Correct!
Results of the question
Which of the following method statements considers the inclusion of a
tuple as parameter?
User's response:
def speak(self, *phrases):
result
Correct!
Results of the question
What property guarantees that two objects are unique despite sharing the
same characteristics and methods?
User's response:
Identity
Result:
Correct!
Results of the questionResults of the question
Correct!
Results of the question
The object-oriented paradigm is a methodology that provides a way
different from organizing and structuring information for complex systems. In
What is this methodology based on?
User's response:
In the interaction of entities
result
Correct!
Which of the following options contains the method declaration of the following
call: [Link](1,2,3,4,5)?
User's response:
def getMaximum(self, *range):
Result:
Correct!
Results of the question
What happens if no value is passed to a method declared with a parameter?
with a predefined value?
User's response:
The method runs with the default value
Result:
Correct!
Results of the question
When defining a class, where should its attributes be declared?
User's response:
Inside the constructor method
result
Correct!
User's response:
Concept
Result:
Correct!
Once a class has been declared and defined, objects can be created using
the following syntax:
User's response:
object = Class()
Result:
Correct!
The use of special parameters is an alternative tool in Python for the:
User's response:
Method overloading
result
Correct!
An object has properties that define it and others that extend its
Functions Which of the following is an extensive property?
User's response:
Inheritance
Result:
Correct!
Correct!
Methods are functions defined by and for the object, which allow its
interaction with the main program and other objects. What property is
defined by these methods?
User's response:
Behavior
Result:
Correct!
Results of the question
In order to create an object, a template or class must be created first.
then define its characteristics. This procedure is known as:
User's response:
Class declaration
Result:
Correct!
Results of the question
The use of special parameters is an alternative tool in Python for the:
User's response:
Method overloading
Result:
Correct!
LESSON 4
User's response:
[Link]
Result:
Correct!
Observe the following code and answer, what instruction generates an error
on screen?
User's response:
g.getSalary2()
Result:
Correct!
User's response:
salary
result
Correct!
User's response:
An error in the console indicating that the method does not exist within the object
Result:
You need to reinforce the topic: Inheritance and method overriding
LESSON 5
We are the miracle of force and matter transforming themselves into it.
the same in imagination and will
print(cadena3.________("transforming", "becoming"))
User's response:
replace
Result:
Correct!
print("_".join("LAPIZ"))
User's response:
split
result
You need to reinforce the topic: Chain methods
Complete the following code with the appropriate method, if required.
change the entire string to uppercase.
Console output
[Link]: no such table: table
User's response:
The table has not been created.
Result:
Correct!
Results of the question
What is the method to execute an SQL statement?
User's response:
execute
result
Correct!
def consult():
db2 = [Link]("[Link]")
You are in the consult function
db2.row_factory = [Link]
query = [Link]()
[Link]("select * from table")
rows = [Link]()
list = []
for row in rows:
s = {}
row['name']
fila['grupo']
[Link](s)
[Link]()
[Link]()
return(list)
consult()
User's response:
To return the created list
Result:
Correct!
In the following code, how many fields does the table have?
import sqlite3
connection=[Link]('[Link]')
query = [Link]()
CREATE TABLE table
(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name VARCHAR(30) NOT NULL,
group INTEGER(9) NOT NULL);
if([Link](table)):
The table was created
else:
The table was not created
close the query
[Link]()
[Link]()
User's response:
2
result
You need to reinforce the topic: Creation of a table
Results of the question
They ask you to verify that a table was created in the database.
How do you do it?
User's response:
You check the writing of the database file
Resultado
Correct!
Results of the question
From the following code, why is the message "You are in" printed?
the insert function?
import sqlite3
db1=[Link]('[Link]')
You are in the insert function
Enter the student's name
group1=input("Enter the group you belong to ")
query=[Link]()
insert into table(name, group) values
('"+name1+"','"+group1+"')
print(strConsulta)
[Link](strConsulta)
[Link]()
[Link]()
[Link]()
User's response:
To verify that the connection was created
Result:
Correct!
Results of the question
In the following code, what is the method that closes the connection?
def consult():
db2 = [Link]("[Link]")
You are in the consult function
db2.row_factory = [Link]
query = [Link]()
[Link]("select * from table")
rows = [Link]()
list = []
for row in rows:
s = {}
row['name']
fila['grupo']
[Link](s)
[Link]()
[Link]()
return(list)
consult()
User's response:
[Link]()
Result:
Correct!
Results of the question
LEVEL 3
LESSON 1
a=b=c=0
for i in range(0,7):
if a > b _____ b > c:
c += 1
b+=1
elif a != 0:
b+=1
a += 1
print "a = " + str(a), " b = " + str(b), " c = " + str(c)
User's response:
and
Result:
Correct!
Results of the question
If no error is found, what label does the language choose to execute
your lines of code?
User's response:
else
Result:
Correct!
User's response:
The program is not complete
Result:
Correct!
In debugging verification, intentional pauses are used,
known as:
User's reply:
Breakpoints
result
Correct!
Results of the question
According to the following code, what should be put as a method in the
last line of code if Juan wants to send a message?
class Person:
def __init__(self, age, name):
age
[Link] = name
Created
def speak(self, words):
print [Link], ': ', words
Person(30, "Juan")
Hello friend
User's response:
to talk
Result:
Correct!
results of the questionResults of the question
What kind of exception should you add to the following code?
try:
i=0
a=32405
while i<=100:
c=a/b
i+=1
b=b-1
print str(i) + ". The division is " + str(c)
except
There is an error
User's response:
except NameError
Result:
Correct!
Lizeth identifies that many errors come from incorrect values.
When an input is requested from the program, what should be implemented?
User's response:
Exceptions
result
Correct!
Results of the question
According to the following code and its result, what is the solution for
correct the error?
class Person:
def __init__(self, age, name):
age
[Link] = name
A new instance has been created for
def speak(self, words):
print [Link], ': ', words
Person
[Link]("Hello friend")
User's response:
Missing parameters to create the constructor
Result:
Correct!
except:
There is an error
User's response:
except TypeError
Result:
Correct!
for i in range(0,10):
[Link](lista1[i])
print list2
except:
There is an error
User's response:
except LookupError
Result:
Correct!
Mitzy realizes that she cannot run her program in the IDE, what about
What type of error is it?
User's response:
Syntax
result
Correct!
In what iteration is y=13? Consider that the first iteration starts with
i=0.
User's response:
5
result
Correct!
Create a table to manually verify the following code.
i=0
x = 55
while i <= 25:
x=x-3
if x == 37:
X is worth less than 40
break
i += 1
print(x)
In which iteration will it display the message "X is less than 40"?
Consider that the first iteration starts with i=0.
User's response:
5
Resultado
Correct!
Results of the question
Results of the question
What type of error is it according to the code and its result?
class Person:
Correct!
Results of the question
According to the following result, where is the logical error if the
The condition is that a > b > c?
a=b=c=0
for i in range(0,7):
if a>b or b>c:
c+=1
b += 1
elif a != 0:
b+=1
a += 1
print "a = " + str(a), " b = " + str(b), " c = " + str(c)
User's response:
In the condition of the if
Result:
Correct!
LESSON 2
User's response:
take courses and certifications
Result:
Correct!
Results of the question
The ___________ is the stage of the general development process of
software where the project requirements are raised.
User's response:
planning
Result:
Correct!
Results of the question
In order to reach a solution to a problem, you must:
User's response:
implement all possible solutions
Result:
You need to strengthen the topic: Professionalization
Results of the question
The database model is developed at this stage:
User's response:
planning
result
Correct!
Results of the question
Some ways to receive feedback are:
User's response:
Thank the changes proposed by others
Listen attentively to other people's points of view
Result:
Correct!
Results of the question
When quoting a project, what factor most significantly determines the price?
of this?:
User's response:
Complexity
result
Correct!
Results of l
Results of the question