The decimal number which is equivalent to binary number 11111011 is 251.
Binary numbers are base-2 numbers, which means they are composed of only two digits: 0 and 1.
Each digit in a binarynumber represents a power of 2, starting from the rightmost digit.
The rightmost digit represents 2⁰ (which is 1), the next digit represents 2¹(which is 2), the next represents 2² (which is 4), and so on.
Given the binary number 11111011:
1 × 2⁷ + 1 × 2⁶ + 1 × 2⁵ + 1 × 2⁴ + 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰
Simplifying each term:
128 + 64 + 32 + 16 + 8 + 0 + 2 + 1
= 251
Hence, 251 is the decimalnumber which is equivalent to binary number 11111011.
To learn more on Binary numbers click here:
#SPJ3
Answer:
251
Explanation:
Lists are used in Python to hold multiple values in one variable
(a) Nested list
A nested list is simply a list of list; i.e. a list that contains another list.
It is also called a 2 dimensional list.
An example is:
nested_list = [[ 1, 2, 3, 4] , [ 5, 6, 7]]
(b) The “*” operator
The "*" operator is used to calculate the product of numerical values.
An example is:
num1 = num2 * num3
List slices
This is used to get some parts of a list; it is done using the ":" sign
Take for instance, you want to get the elements from the 3rd to the 5th index of a list
An example is:
firstList = [1, 2 ,3, 4, 5, 6, 7]
secondList = firstList[2:5]
The “+=” operator
This is used to add and assign values to variables
An example is:
num1 = 5
num2 = 3
num2 += num1
A list filter
This is used to return some elements of a list based on certain condition called filter.
An example that prints the even elements of a list is:
firstList = [1, 2 ,3, 4, 5, 6, 7]
print(list(filter(lambda x: x % 2 == 0, firstList)))
A valid but wrong list operation
The following operation is to return a single list, but instead it returns as many lists as possible
def oneList(x, myList=[]):
myList.append(x)
print(myList)
oneList(3)
oneList(4)
Read more about Python listsat:
Severe injuries or death
Neurological damage
Amputations
In almost all cases, touching power lines or coming into contact with energized sources will result in Severe injuries or death. Thus, option second is correct.
Electrical, mechanical, chemical, pneumatic, chemical, thermal, and other energy sources in machinery and equipment can be harmful to employees.
De-energization may entail turning off a machine and unplugging it, or removing a switch before applying a lock to prevent the equipment from being accidentally starting up. Lockout can be enforced once energization is complete.
Touching electricity lines or making contact with electrical sources will almost always result in severe injury or death. As a result, option two is correct.
Learn more about sources here:
#SPJ2
Answer:
Severe injuries or death
Explanation:
B. -2
C. "Open"
D. +2
Answer:
D. +2
Explanation:
The given function is an IF function where the first argument is a logical test, the second argument is the result if the logical test is true and the third argument is the result if the logical test is false. Depending on whether the result of the logical test is true or false, the respective value will be returned.
IF(logical_test, value_if_true, value_if_false)
In this case, the logical test first compares the value of B3 and D5. As B3 is not greater than D5, the result is false and the value for false will be returned. The value for false result of the logical test is equated by D5-B3 which is equal to 2. Thus the result of the IF function is +2.
environmentvariable.
resultvariable.
independentvariable.
constant.
Answer: An objective function in linear programming is a decision variable.
Explanation: An objective function is a function which has the target towards the model whether it should be maximized or minimized according to the relation between the variables present in the function. There are set of variables which are responsible for the controlling of objective function that is known as decision variables.
>>>lst = [4, 1, 2, -1]
>>>fun3(list)
-8
Answer:
Here is code in Python:
#function to swap first and last element of the list
#and calculate product of all elements of list
def fun3(e):
product = 1
temp = e[0]
e[0] = e[-1]
e[-1] = temp
for a in e:
product *= a
return product
#create a list
inp_lst = [4, 1, 2, -1]
#call the fun3() with parameter inp_lst
print("product of all elements of list is: ",fun3(inp_lst))
#print the list after swapping
print("list after swapping first and last element: ",inp_lst)
Explanation:
Create a list "inp_lst" and initialize it with [4,1,2,-1]. In the function fun3() pass a list parameter "e". create a variable "product" to calculate the product of all elements.Also create a temporary variable to swap the first and last element of the list.
Output:
product of all elements of list is: -8
list after swaping first and last element: [-1, 1, 2, 4]
Answer:
// Here is code in C.
#include "stdio.h"
// create function to print all the combinations
void print_combi(char a,char b,char c)
{
// print all combinations of three characters
printf("%c%c%c %c%c%c %c%c%c %c%c%c %c%c%c %c%c%c\n",a,b,c,a,c,b,b,a,c,b,c,a,c,a,b,c,b,a);
}
// driver function
int main(void)
{
// create 3 char variable and initialize
char a='x',b='y',c='z';
// call the function
print_combi(a,b,c);
printf("\n");
// initialize with different character
a='1',b='2',c='3';
// call the function
print_combi(a,b,c);
printf("\n");
// initialize with different character
a='#',b='$',c='%';
// call the function
print_combi(a,b,c);
printf("\n");
return 0;
}
Explanation:
Create three char variables a, b, c. First initialize them with x, y, z. then call the function print_combi() with three parameters . this function will print all the combinations of those characters.We can test the function with different values of all the three char variables.
Output:
xyz xzy yxz yzx zxy zyx
123 132 213 231 312 321
#$% #%$ $#% $%# %#$ %$#
A C program to find all combinations of character variables:
void main ()
{
char f;
char s;
char t;
f = 'x';
s = 'y';
t = 'z';
System.out.print("" + f + s + t + " " + f + t + s + " " + s +f + t +
" " + s + t + f + " " + t + f + s + " " + t + s + f);
}
}