1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leviafan [203]
3 years ago
14

What is the value of y when this code executes?

Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
4 0

Answer:

The operation of 6*x only executes if x is greater or equal to 0, since x=-10 and -10 is less than 0, the operation does not execute. For this reason,  the value of y using this code is None.

Explanation:

In python a function is defined with the syntaxis:  

def function(x):  

the operation to execute (x)

value to return

In this case, the function is foo and the parameter is x:  

def foo(x):

  if x>= 0:

     return 6*x

The code starts by assigning a value to x. Then, the code asks if the value of x is grater or equal to 0, if this condition is meet, then the code returns the value of 6 times x, if not, then the code does not return a value. In this case, x is -10 and this value is not grater or equal to 0. Given that the condition is not met, then the code stops executing and the value of y is none.

You might be interested in
Justify the statement "The same job title can have different job roles and different qualification criteria in different organiz
Colt1911 [192]

Answer:

anng elsi

Explanation:

3 0
3 years ago
Which camera does Angelina use?
julia-pushkina [17]

Answer:

mirrorless cameras have lot more space due to not having mirrors. and they have the same or better quality than DSLR's.

8 0
3 years ago
What is used to give credit to the source from which information is obtained?
Sati [7]
The Answer is (A) because a citation gives credit to the sources from which your information was obtained. Linkage has nothing to do with it... Plagiarism is the exact opposite of that.... And a format is just a way something is in order or arranged.
8 0
3 years ago
When receiving your bank account, you should immediately do what
maxonik [38]

Answer:

give ur account details to everyone in the world

Explanation:

6 0
2 years ago
Why is the choice of form factor critical when building a computer from scratch?
faltersainse [42]
More features/more space makes things easier to work on and cool down
6 0
3 years ago
Other questions:
  • What is the purpose of the print area feature​
    11·1 answer
  • What is the acronym that helps you remember the order of math operations?
    9·2 answers
  • What is the letter for the trash directory on windows 10?
    13·2 answers
  • Commands are organized into tabs on the
    8·2 answers
  • Fortnite anyone? i just started tdy so dont be judgiee lol
    6·2 answers
  • The _____, a subcortical brain structure crucially involved in storing new information in memory, is smaller in people with schi
    8·1 answer
  • Rosa is a high school freshman with no savings. She wants to buy a new smartphone in a few months for $300. Which account type b
    9·2 answers
  • What is the output?
    13·1 answer
  • Have all of my coins because i will delete acount there will be part 2, 3 , 4 ,5,6,7,8
    15·2 answers
  • Photo editing software, desktop publishing, email and word processing software is most likely to be used by:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!