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
Mariana [72]
3 years ago
12

A Python programmer is writing a function definition. What syntax should be used?

Computers and Technology
2 answers:
rewona [7]3 years ago
7 0

Answer:

def functionName( arguments ):

statement1

statement2

statement3

Explanation:

Ber [7]3 years ago
6 0

Answer:

Python - Functions

Advertisements

A function is a block of orgaof code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree ofAdvertisement

As you already know, Python gives you many built-in functions like print(), etc. but you can also create your own functions. These functions are called user-defined functions.

Defining a Function

You can define functions to provide the required functionality. Here are simple rules to define a function in Python.

Function blocks begin with the keyword def followed by the function name and parentheses ( ( ) ).

Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses.

The first statement of a function can be an optional statement - the documentation string of the function or docstring.

The code block within every function starts with a colon (:) and is indented.

The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None.

You might be interested in
One foot equals 12 inches. Write a function named feet_to_inches that accepts a number of feet as an argument and returns the nu
fenix001 [56]

Answer:

def feet_to_inches( feet ):

      inches = feet * 12

      print(inches, "inches")

feet_to_inches(10)

Explanation:

The code is written in python.  The unit for conversion base on your question is that 1 ft = 12 inches. Therefore,

def feet_to_inches( feet ):

This code we define a function and pass the argument as feet which is the length in ft that is required when we call the function.

inches = feet * 12

Here the length in ft is been converted to inches by multiplying by 12.

print(inches, "inches")

Here we print the value in inches .

feet_to_inches(10)

Here we call the function and pass the argument in feet to be converted  

       

8 0
3 years ago
The possible states of a process are:
Oliga [24]

Answer:

a. new, running, waiting, ready, and terminated.

Explanation:

The process in a computer system can have different states and these are:

-New: When the process is created.

-Ready: When the process is waiting to be executed.

-Running: When the process is chosen to be executed.

-Waiting: When the process is expecting for something to happen.

-Terminated: When the process is not running anymore.

According to this, the answer is that the possible states of a process are: new, running, waiting, ready, and terminated.

3 0
3 years ago
Read 2 more answers
Select all that apply.
True [87]

Answer:

                                          Option    A, B & C   are correct answers .

Explanation:

   

4 0
3 years ago
Read 2 more answers
Consider Ron’s budget. How much money does Ron have left over each month?
vladimir1956 [14]
What is Ron’s budget?
4 0
3 years ago
Read 2 more answers
A spreadsheet has some values entered: Cell A1 contains 10, cell A2 contains 14, cell A3 contains 7. You enter in cell A4 the fo
Alinara [238K]
A1 is 10, so your answer is 10+2=12
B. 12
6 0
3 years ago
Read 2 more answers
Other questions:
  • Blogs are typically written by large companies or organizations as a way to express formal, technical, or scholarly information
    5·2 answers
  • How would this requirement be implemented?
    12·1 answer
  • Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe mor
    14·1 answer
  • To create a new query in Design view, click CREATE on the ribbon to display the CREATE tab and then click the ____ button to cre
    9·1 answer
  • How to use repl.it css
    7·1 answer
  • When replacing a thermostat or water pump, coolant drained from the cooling system should be ________.
    9·1 answer
  • Please help me willgive u brainliest​
    14·1 answer
  • g Which of the following factors primarily determines how the Internet is used in different countries? A. local attitude to info
    6·1 answer
  • To reduce the potential for repetitive stress injury you should use proper?
    6·1 answer
  • Suppose a large group of people in a room were all born in the same year. Consider the following three algorithms, which are eac
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!