Answer:
what is that I don't understand I am from china
Answer:
- def longest(L):
- for x in L:
- if(len(x) % 2 == 0):
- if(x.endswith("ing")):
- return x
- return ""
-
- print(longest(["Playing", "Gaming", "Studying"]))
Explanation:
The solution is written in Python 3.
Firstly, create a function longest that takes one parameter L as required by question (Line 1).
In the function, create a for loop to traverse through each string in L and check if the current string length is even (Line 2 - 3). If so, use string endwiths method to check is the current string ended with "ing". If so return the string (Line 4-5).
At last, test the function by passing a list of string and we shall get the output "Gaming".
Answer:
video games are used with qraphecs and software is compute
Explanation:
Answer:
The result of the following code will be 9
Explanation:
There are several operators used in Python to do mathematical calculations.
** operator is used for exponents.
i.e.
a ** b mathematically means a^b
Here in the given code
3 is assigned to numA and 2 is assigned to numB
Result will be equal to 3^2
Hence,
The result of the following code will be 9
Answer:
an instance variable is a variable that is within a class but it is outside of constructors, methods or blocks.
the instance variables for the class bankAccount can be accountNumber, account holder name and balance.
below are the types and names declared to hold the information.
private string accountHolderName;
private int accountNumber;
private double balance;
note:
accountHolderName is a string data type because names are in alphabets.
accountNumber is an integer since they are in numbers.
balance is a double data type because it is a floating point number.