Answer:
# Code in Python
dictionary={'A':1,'B':2,'C':3,'D':4}
other_dictionary={}
for keys in dictionary:
if dictionary[keys]&1==1:
temp=dictionary[keys]*dictionary[keys]-10*10
other_dictionary[keys]=temp
else:
other_dictionary[keys]=dictionary[keys]
print(other_dictionary)
assert other_dictionary
Explanation:
- Initialize a sample example dictionary and other_dictionary.
- Do a binary comparision for checking odd number
.
- Update the the value stored in the dictionary to store the squared difference of the original value and '10'.
- For even: store the original value (from dictionary).
I guess the correct answer is the Enter key
Οn cοmputеr kеybοards, thе еntеr kеy in mοst casеs causеs a cοmmand linе, windοw fοrm, οr dialοg bοx tο οpеratе its dеfault functiοn. This is typically tο finish an "еntry" and bеgin thе dеsirеd prοcеss, and is usually an altеrnativе tο prеssing an ΟK buttοn.
Answer:
n computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integernumbers (of varying sizes), floating-point numbers (which approximate real numbers), characters and Booleans. A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression(i.e. variable, function, etc.) may take its values.[1][2]
Explanation:
1. radio transmission.
2. microwave transmission
3. infrared transmission.
Answer:
bears = {"Grizzly":"angry", "Brown":"friendly", "Polar":"friendly"}
for bear in bears:
if bears[bear] == "friendly":
print("Hello, "+bear+" bear!")
else:
print("odd")
Explanation:
A dictionary called bears is given. A dictionary consists of key-value pairs.
You need to check each key-value pairs in bears and find the ones that have "friendly" as value using a for loop and if-else structure. In order to access the values of the dictionary, use the dictionary name and the key (inside the loop, the key is represented as bear variable). If a key has a value of "friendly", print the greeting. Otherwise, print "odd".