Answer:
You may use a different variable type for input in order to process the data appropriately and may use a different variable type to accommodate your program.
Explanation:
Your input may have to be different then output varying on what data you are processing.
For example, just like the last question you asked about calculating the area of the rectangle, your input MUST be converted to a different a numerical data type (i.e int or float) in order to do the math.
Based on your last question, if we didn't convert your input into a string your results wouldn't add the numbers together but only concatenate them. If I typed 3 & 5 as length & width, I would get 35 instead of 15.
Now another example is using functions (or methods whatever you want to call them), your input can be one thing and outputs another.
Let's say I want a function to tell me if I am smart. The way I want it to determine if its smart is by inputting my GPA into it, which is a numerical value. So the function would look something like this:
<u>Code (Python)</u>
def IsSmart(gpa):
if (gpa >= 4):
return True
else
return False
As you can see I am inputting a numerical value and it is outputting a boolean value. I can use this in a if else chain to spit out an output to the user.
Answer: d) Hierarchy of data
Explanation:
- Hierarchy of data is defined as arrangement of data in systematic way .The arrangement of files,character,records etc is done in a particular order usually in terms of highest level and lowest level .
- According to the question ,hierarchy of data should be used for organizing data from smallest stage to highest stage for database designing.
- Other options are incorrect alphabetical designing is based on alphabetical order. Detail structure is a model made on basis of details and features.
- Data design is the model or structure that includes data and related factors as building block.Logical order is the organizing elements on basis of particular logic.
- Thus, the correct option is option(d).
Explanation:
The working directory is just a file path on your computer that sets the default location of any files you read. If you want to read a file 'file.txt'.
Answer:
class Foo:
def F(self, n):
if n == 1:
return 1
return self.F(n - 1) + 3 * n - 2
Explanation:
This should cover part a to this question. The thing I'm not sure on is they use the term "method" which in python technically means a class function...but then list one argument with the function call which makes me think it is possibly just supposed to be a regular function. Which would be the following snippet. It would depend on if you are using classes or not yet in your coding class.
def F(n):
if n == 1:
return 1
return F(n - 1) + 3 * n - 2
Play around with it and look into python "lists" and "for loops" for part c. Part b I'm not sure what kind of example they want since I'm not in that class. Good luck!
ksoxkajsjjwjxjxiqwikwkak,hsjsjskxkososlajzhxjwjskksoa