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
kirza4 [7]
2 years ago
6

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

Computers and Technology
1 answer:
Kay [80]2 years ago
8 0

Answer:

<u>Syntax of function in the Python Programming Language.</u>

def function_name():

   '''body of the function or code'''

#calling of the function

function_name()

Note: In Python Programming Language, Indentation is sensitive if you not focus on the indentation then, you program occurs an indentation error.

Explanation:

In Python Programming language, we can use the "def" keyword to define a function then we write the name of the function and then use parentheses for the argument list. "#" is used for the single-line comment and " ''' ''' " is used for the multiple line comment.

A function is the part or module of the program which provides users the feature of reusability of that code anywhere only by calling them.

You might be interested in
For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
Marrrta [24]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

int main()

{

// Declare variables

int childticket, adultticket, childprice, adultprice;

double total, net, distributor;

string movie;

// Prompt user for name of movie

cout<<"Movie Name; ";

// Accept input for movie name

cin>>movie;

// Prompt user and accept input for price of adult tickets

cout<<"Adult Ticket Price: $";

cin>>adultprice;

// Prompt user and accept input for price of child tickets

cout<<"Child Ticket Price: $";

cin>>childprice;

// Prompt user and accept input for number of sold adult tickets

cout<<"Adult Ticket Sold: ";

cin>>adultticket;

// Prompt user and accept input for number of child tickets sold

cout<<"Child Ticket Sold: ";

cin>>childticket;

// Calculate total

total = childticket * childprice + adultticket * adultprice;

// Calculate distributor's payment

distributor = 0.25 * total;

// Calculate net box pay

net = 0.75 * total;

// Display and format results

cout<<"Gross Box Office Revenue: $";

printf("%.2f",total);

cout<<"\n Amount Paid to Distributor: -$";

printf("%.2f", distributor);

cout<<"\nNet Box Office Revenue: $";

printf("%.2f",net);

return 0;

}

6 0
2 years ago
What are the syntax of c programming language?
user100 [1]

the syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language.

The syntax of the C programming language, the rules governing writing of software in the language, is designed to allow for programs that are extremely terse, have a close relationship with the resulting object code, and yet provide relatively high-level data abstraction. C was the first widely successful high-level language for portable operating-system development.

8 0
2 years ago
The Knowledge Consistency Checker (KCC) ensures the maximum number of hops between any two domain controllers does not exceed wh
Katarina [22]

Answer:

Three (3)

Explanation:

Explanation of the three basic terms here - Knowledge consistency checker, hops and domain controller - will give a clearer answer and explanation to the question as follows;

<em>Domain controller</em> : is a server controller that gives access or controls to users on computer networks by first responding to their authentication requests and verifying those users. In other words, a domain controller is a network security manager.

<em>Hop</em> : A hop is simply the passage of data packets from one network to another. As  a packet moves from its source to destination, it moves from router to router. The number of such routers that the packet passes through is called a hop.

<em>The Knowledge Consistency Checker (KCC)</em> :  It is the job of the KCC to ensure that these domain controllers participate in the replication promptly and orderly. Replication means copying data from one location to another (within a network or among networks). The KCC ensures that the maximum number of hops permitted is does not exceed 3. i.e no domain controller is more than 3 hops from any other domain controller within a network.

Note: Replication is of two types - intrasite (among all domain controllers within a site) and intersite (among all domain controllers in different sites), and the KCC can manage both type of replication. Also, by default, at every 15 minutes interval, a domain controller generates a replication topology (a logical map that dictates the domain controllers that will replicate with each other).

<em>Hope this helps!</em>

3 0
2 years ago
Which are guidlines for using themes? Check all that apply
Andreyy89

Answer: A. Using different cell styles can help you differentiate different types of data.

B. Fonts should be easily readable and of appropriate size.

D. Be consistent with themes across worksheets and workbooks.

Explanation:

A theme refers to the preset package that contains functionality details and graphical appearance.

The guidelines for using themes include:

• Using different cell styles can help you differentiate different types of data.

• Fonts should be easily readable and of appropriate size.

• Be consistent with themes across worksheets and workbooks.

Therefore, the correct options are A, B and D.

7 0
3 years ago
What is the difference between manual and computer typesetting?
Burka [1]

Answer:

Manual typesetting: The form was placed in a press, inked, and an impression made on paper. During typesetting, individual sorts are picked from a type case with the right hand, and set into a composing stick held in the left hand from left to right, and as viewed by the setter upside down.

Computer typesetting: Computerized typesetting, method of typesetting in which characters are generated by computer and transferred to light-sensitive paper or film by means of either pulses from a laser beam or moving rays of light from a stroboscopic source or a cathode-ray tube (CRT).

6 0
3 years ago
Other questions:
  • This question involves the creation of user names for an online system. A user name is created based on a user’s first and last
    13·1 answer
  • Suppose you find a magic $1.00 coin. Its magic power is as follows: as each day passes, you get an additional dollar plus half o
    6·1 answer
  • How can vlan hopping attacks be prevented on a network?
    10·1 answer
  • The TabIndex value assigned to a text box's identifying label must be _______________ for the text box's access key to work corr
    14·1 answer
  • Which computer is the best for video cutting?
    11·2 answers
  • What's a sentence with the words trickle and resume in it? they can be in any tense. Thanku​
    5·1 answer
  • What was the process called that required the photographer to have a tent or darkroom handy so that chemicals could be mixed qui
    7·1 answer
  • Translate the following C++ program to MIPS assembly program. *Please explain each instruction of your code by a comment and sub
    5·1 answer
  • 8.2 Code Practice Edhesive
    6·1 answer
  • What is output by the following code?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!