Answer:
The solution code is written in Python 3:
- import keyword
-
- def checkValidVariable(string):
- if(not keyword.iskeyword(string)):
- return True
- else:
- return False
-
- print(checkValidVariable("ABC"))
- print(checkValidVariable("assert"))
Explanation:
Firstly, we need to import keyword module so that we can use its iskeyword method to check if a string is registered as Python keyword (Line 1).
Next, we create a function checkValidVariable that takes one input string (Line 3). Within the function body, we use iskeyword method to check if the input string is keyword. Please note the "not" operator is used here. So, if iskeyword return True, the True value will be turned to False by the "not" operator or vice versa (Line 4-5).
We test the function by passing two input string (Line 9-10) and we shall get the sample output as follows:
True
False
Answer:
Following are the statement in C++ Language is given below
total=0; // variable declaration
cin >> amount; // Read the input
while(amount >=0) //iterating the loop
{
if(amount>0) // checking condition
total=total+amount; // perform operation
}
Explanation:
Following is the description of the statement
- Declared a variable "total" and initialized with them 0 to them.
- Read the input in the "amount" variable by using cin.
- iterating the loop when the amount is greater then 0.
- Checking the condition if(amount>0) then adding the total variable and amount and storing them into the total variable.
Answer:
d.Relational
Explanation:
With the help of Access users can successfully manage valuable information by saving it easily for future reporting it , and analysis.In access users can have access to organized data in their database with minimal effort.
You can enter the data and you can select which data you want and use queries for that accordingly for example:- joins,select statements etc.
<span>To build a team site and collaborate with your colleagues</span>