Tech Flashcards
Which of the following best defines a function in programming?
1.A predefined command that performs a specific task.
2.A block of organized, reusable code used to perform a single action.
3.A variable that stores multiple values.
4.A method to define the syntax of a programming language.
- To store data values.
Which of the following best defines a function in programming?
A predefined command that performs a specific task.
A block of organized, reusable code used to perform a single action.
A variable that stores multiple values.
A method to define the syntax of a programming language.
- A block of organized, reusable code used to perform a single action.
What is a Boolean Operator ?
Compare two values and then returns the value TRUE (1) or FALSE (0)
What does the Operator “ ==” means as a Boolean Operator ?
The operation is true if the two value are equal
What does the Operator “ !=” means as a Boolean Operator ?
The operation is true if the two value are different
What does the Operator “ >” means as a Boolean Operator ?
The operation is true if the value to the right of the operator is less than the one on the left
What does the Operator “ <” means as a Boolean Operator ?
The operation is true if the value on the right of the operator is less than the one on the left
What does the Operator “ >=” means as a Boolean Operator ?
The operation is true if the value on the right of the operator is greater than or equal to the one on the left
What does the Operator “ <=” means as a Boolean Operator ?
The operation is true if the value on the right of the operator is less than or equal to the one on the left
What is used as connector of two Boolean Operations ?
AND e OR
What is an “ if-else” Statement ?
It’s a conditional statement that run a different sets of command depending on wether an expression is true or false.
What is the difference between an For loop and a While loop ?
in “for loop” the number of repetition to be done is already know and used for a result . In “while loop” the command run until a certain condition is reached and the statement is proved to be false.
What the use of a “for loop” and it’s code ?
performs predefined task until a condition is met.
for<counter> in range<counter>, <counter end +1>: <something></something></counter></counter>
What is a range and how do you code it ?
an range is a list of element: range(0,n)=[0,1,…,n-1]
What is a “while loop” and it’s code
It’s a statement that allow code to be executed repeatedly based on a condition statement.
while <condition>: <something></something></condition>