Answer:
- def Lambda(strList):
- return list(filter(lambda s: (s.startswith("e")), strList))
-
- print(Lambda(["meaning", "cart", "engine", "egg"]))
Explanation:
The solution code is written in Python 3.
Lambda function is an anonymous function. It is a function without any name and it is started with keyword lambda. To write a lambda function to filter the string started with an 'e', we can write a lambda expression, s.startswith("e") that work on one input strList. If any word from strList started with letter "e", the word will be added into a list generated by filter function. At the end, the Lambda function will return the list of strings as output.
When we test the Lambda function using the sample string list (Line 4), we shall get ['engine', 'egg'] printed to terminal.
Answer:
import java.util.*;
import java.io.*;
class Main {
public static void main(String[] args) {
int a,b,lcm1;
System.out.println("Enter two integers: ");
Scanner s12=new Scanner(System.in);
a= s12.nextInt();
b=s12.nextInt();
// maximum number between n1 and n2 is stored in lcm
lcm1 = (a > b) ? a : b;
// Always true
while(true)
{
if( lcm1 % a == 0 && lcm1 % b== 0 )
{
System.out.printf("The Least common multiple of %d & %d is %d.", a, b, lcm1);
break;
}
++lcm1;
}
}
}
Explanation:
You can find the LCM of two integers using the program in java written above in answer section.
Answer:
Using a one time password OTP and using a three factor authentication.
Explanation:
Social engineering is a form system and network attack, drafted by an attacker, to steal user credentials needed for accessing their accounts, to steal information.
Social engineering attacks like phishing, spear phishing, baiting and quid quo pro are used to fool users to giving out their user details.
One time password is an implied use of a password just once and a new password his generated to boost security. In a three factor authentication, OTP can be used as well as biometrics of a user which can not be giving away by a user to an attacker.