The required code written in python 3 which returns the average of the strings in a list goes thus :
def average_strings(string_list):
#initializeafunctionnamedaverage_stringwhichtakesinalistofstringasparameter
total_length = 0
#initializetotallengthofstringto0
if len(string_list)==0:
#checksofthe stringisempty
return 0
#ifstringisemptyreturn0
for word in string_list :
total_length += len(word)
#addthelength ofeachstringtothetotallengthofthe string.
return total_length / len(string_list)
#returntheaveragevalue
A sample run of the function is given here and the output attached.
string_list = ['dog', 'cat', 'mouse']
print(average_strings(string_list))
Learn more :brainly.com/question/15352352
Answer:
def average_strings(lst):
total = 0
if len(lst) == 0:
return 0
for s in lst:
total += len(s)
return total / len(lst)
Explanation:
Create a function called average_strings that take one parameter, lst
Initialize a total to hold the length of the strings in lst
If the length of lst is 0, return 0
Otherwise create a for loop that iterates through the lst. Calculate the length of each string in lst and add it to total
When the loop is done, return the average, total length of the strings divided by length of the lst
Answer:
The anagram is the type of word and phase that are formed by the rearranging the another letter with the word and phase.
The anagram is the type of network server that produce the anagram and it is use as the code and pseudonyms.
If the anagram is create by someone then, the person is known as anagrammatist. Its main goal is to produce the anagram which reflect on their particular subject. The anagram word can also be represented or rearranged into the nag a ram.
b. Computer simulations only run on very powerful computers that are not available to the general public.
c. Computer simulations usually make some simplifying assumptions about the real-world object or system being modeled.
Answer:
The answer is "Option c".
Explanation:
Computer simulation, use of a machine to simulate a system's vibration signals by another modeled system's behaviors. A simulator employs a computer program to generate a mathematical model or representation of a true system. It usually gives a lot of simplifications concerning the physical image or system that is modeled, so this statement describes the limitation of using a computer simulation in modeling a real-world object or process.
Answer:
a. social engineering attack
Explanation:
Two-factor authentication requires that the user/owner of the account enter a second verification code alongside their password in order to access the account. This code is usually sent to a personal phone number or email address. Therefore in order to breach such a security measure the best options is a social engineering attack. These are attacks that are accomplished through human interactions, using psychological manipulation in order to trick the victim into making a mistake or giving away that private information such as the verification code or access to the private email.
100
import java.util.Scanner;
public class ProductCalculator {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userNumber;
userNumber = scnr.nextInt();
while(userNumber >= 40){
userNumber = userNumber * 4;
System.out.println(userNumber);
}
Java. What am I doing wrong? It's not giving an output.
}
}
Change this line;
with;
The loop will never start because userNumber is not already greater than 40.
A lot of laptops and desktop computers are known to have built-in slots that can connect with a cable lock. A person can keep their Laptops from getting Lost or stolen by;
learn more about laptop from
Answer & Explanation:
No Browsing History:
Phishing Scam
Suspicious File Attachment
Antivirus Software Outdated
Laptop's Physical Security
The number of bits that are needed for this operation code (opcode) is 8 bits.
Binary encoding can be defined as a standard technique that is designed and developed for converting data in plain text (source alphabets) to a form that is easily used by different operating systems (OS), especially through the use of a binary digit (bit) or two-symbol system.
The number of bits that are needed for this operation code (opcode) is given by this mathematical expression:
n = 8 bits.
b. To determine the number of bits that are left for the address part of the instruction:
Address = 16 bits.
c. To determine the maximum allowable size for memory:
Based on the memory unit, this is given by
d. The largest unsigned binary number that can be accommodated in one word of memory is given by:
Read more on binary encoding here: brainly.com/question/5381889
Answer:
a) 8 bits b) 16 bits. c) 2¹⁶ * 24 bits d) 2²⁴ -1
Explanation:
a) In order to be able to accommodate 150 different instructions, the number of bits needed must be equal to the minimum power of 2 that satisfies this equation:
2n > 150, i.e. n=8.
b) If the total number of bits for a word is 24, and 8 are used for the op code, there are 16 bits left for the address part.
c) If the address part has 16 bits, this means that the total addressable space is just 2¹⁶, so the maximum allowable size is 2¹⁶ * 24 bits.
d) As we have 24 bits to be filled, the largest unsigned binary number is just 2²⁴ – 1.
(As we need to leave a position for all zeros).