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
andrew11 [14]
3 years ago
10

How to use function in python

Computers and Technology
1 answer:
ivann1987 [24]3 years ago
6 0

Answer:

Use the keyword def to declare the function and follow this up with the function name.

Add parameters to the function: they should be within the parentheses of the function. ...

Add statements that the functions should execute.

You might be interested in
Which of the following statements is false? A constructor is similar to a method but is called implicitly by the new operator to
Volgvan

COMPLETE QUESTION:

Which of the following statements is false?

A) A constructor is similar to a method but is called implicitly by the new operator to initialize an object's instance variables at the time the object is created.

B0 Scanner method next reads characters until any white-space character is encountered, then returns the characters as a String.

C)A class instance creation expression begins with keyword new and creates a new object.

D) To call a method of an object, follow the object name with a comma, the method name and a set of parentheses containing the method's arguments.

Answer:

D) To call a method of an object, follow the object name with a comma, the method name and a set of parentheses containing the method's arguments.

Explanation:

To call a method, the name of the object is not followed by a comma (,) but with a dot (.) operator, the method's name and a set of parentheses containing the method's arguments, then follows.

4 0
3 years ago
when the programmers embed a javascript code within html code they place the javascript code between​
taurus [48]
<h3>When the programmers embed a javascript code within html code they place the javascript code between</h3>

Answer: They place the javascript code between a pair of <script> and </script> tags, inside HTML documents.

\textit{\textbf{Spymore}}​

3 0
3 years ago
Read 2 more answers
Change the Towers of Hanoi program so that it does the following: a)Counts the number of ring moves and prints that - instead of
aniked [119]

Answer:

Following are the program in the Java Programming Language.

//import scanner class package

import java.util.Scanner;

//define class

public class Tower_of_Hanoi {

//define static integer variable

public static int count = 0;

//define function

public static void Permute_Arrange(int n, char x, char ax, char to) {

//set if statement

if (n == 1) {

//increament in count by 1

++count;

}

//otherwise  

else  

{

Permute_Arrange(n - 1, x, to, ax);

++count;

Permute_Arrange(n - 1, ax, x, to);

}

}

//define main function

public static void main(String[] args)  

{

//set scanner type object

Scanner sc = new Scanner(System.in);

//print message

System.out.println("Enter less than 0 to exit");

//set the while infinite loop

while(true)

{

//print message

System.out.print("Enter the number of Disks: ");

//get input from the user

int num_of_disk = sc.nextInt();

//set the if statement to break the loop

if(num_of_disk<0)

{

//exit from the loop

System.exit(0);

}

//call the function

Permute_Arrange(num_of_disk, 'A', 'B', 'C');

//print message with output

System.out.println("Total number of Disc Moves is: " + count);

count = 0;

}

}

}

<u>Output:</u>

Enter less than 0 to exit

Enter the number of Disks: 4

Total number of Disc Moves is: 15

Enter the number of Disks: 7

Total number of Disc Moves is: 127

Enter the number of Disks: -1

Explanation:

Here, we define a class named "Tower_of_Hanoi"

  • Set the integer data type static variable "count" and initialize the value to 0.
  • Define void data type static function "Permute_Arrange" and pass three characters type arguments "x", "ax", and to and one integer type argument "n", inside it we set if condition to increment in the count variable otherwise call the function.
  • Finally, we define the main function to get input from the user and pass the argument list in function and call the function.
8 0
4 years ago
Truncation is a keyword search technique that helps you find useful variations of a term or terms. You want to find books on the
sergiy2304 [10]

Answer:

gravit* and collapse

Explanation:

Truncation is a keyword search technique that helps you find useful variations of a term or terms.

To find books on the topic of gravity and gravitational collapse, the best part to truncate is gravit* and collapse.

4 0
3 years ago
Alcohol and drugs
vitfil [10]
I would have to say B
3 0
3 years ago
Other questions:
  • Type the correct answer in the box. Spell all words correctly.
    14·1 answer
  • Discuss how advertising on the Web affects search results and the ethical dilemmas associated with it.
    5·1 answer
  • Using illustration how input, process and output in latest wearable devices
    10·1 answer
  • You are manually configuring a tcp/ip host. another administrator gives you the router's ip address. what is the tcp/ip term for
    6·2 answers
  • In the code that follows, window is a/an ____________________________. window.prompt("enter your name");
    5·1 answer
  • Please help ASAP, will mark brainliest!
    10·1 answer
  • What happens when you double-click a column border??
    12·1 answer
  • The development methodology where each part of a project is done in order after each other is called:
    15·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
  • Television, the internet, and smartphones are different communication _______blank hsn uses in its imc.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!