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]
3 years ago
6

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

Computers and Technology
1 answer:
Kay [80]3 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
Describe the user interface in other high-technology devices commonly found in the home or office, such as a smartphone, HD tele
Vadim26 [7]

Answer:

Explanation:

Different technologies use different user interface designs in order to make the user experience as easy and intuitive as possible. This varies drastically from one device to another because of the capabilities and size of each device. If we take a fitness/smart watch into consideration, this device does not use pop up menus or side scrolling menus but instead uses large full screen menus where each option nearly fills the entire screen. That is done because the smart watch screens are very small and making everything full screen makes reading and swiping through options that much easier for the user. If the user interface were the same as in a television or smartphone it would be impossible to navigate through the different options on such a tiny screen.

7 0
3 years ago
Explain the unique reason why assember language is perfered to high level language
Zigmanuir [339]

The unique reason why assembler language is preferred to high level language is that  It is said to be memory efficient and it is one that requires less memory.

<h3>Why is assembly language better than other kinds of high level?</h3>

It implies means that the programs that one uses to write via the use of high-level languages can be run easily on any processor that is known to be independent of its type.

Note that it is one that has a lot of  better accuracy and an assembly language is one that carries out a lot of better functions than any high-level language, in all.

Note also that the advantages of assembly language over high-level language is in terms of its Performance and accuracy as it is better than high-level language.

Hence, The unique reason why assembler language is preferred to high level language is that  It is said to be memory efficient and it is one that requires less memory.

Learn more about assembler language from

brainly.com/question/13171889

#SPJ1

3 0
1 year ago
Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha. Wri
Alina [70]

Answer:

In Java:

public static  int[] inputArray(){

   Scanner input = new Scanner(System.in);

   int[] alpha = new int[20];

   for(int i = 0;i<20;i++){

       alpha[i] = input.nextInt();

   }

   return alpha;}

public static  int[] doubleArray(int [] alpha){

   int[] beta = new int[20];

   for(int i = 0;i<20;i++){

       beta[i] = 2 * alpha[i];

   }

   return beta;

}

public static int[] copyAlphaBeta(int [] alpha, int [] beta){

   int [] AlphaBeta = new  int[10];

   for(int i = 0;i<5;i++){

       AlphaBeta[i] = alpha[i];

   }

   int count = 5;

   for(int i = 15;i<20;i++){

       AlphaBeta[count] = beta[i];

       count++;

   }

   return AlphaBeta;

}

public static void printArray(int [] alpha){

   for(int i = 0;i<20;i++){

       System.out.print(alpha[i]+" ");

       if((i+1)%15 == 0){

           System.out.println(" ");

       }

   }

}

Explanation:

The inputArray is defined here

public static  int[] inputArray(){

   Scanner input = new Scanner(System.in);

This declares alpha array of 20 elements

   int[] alpha = new int[20];

The following iteration gets input from the user into the array

<em>    for(int i = 0;i<20;i++){</em>

<em>        alpha[i] = input.nextInt();</em>

<em>    }</em>

This returns the alpha array

   return alpha;}

The doubleArray is defined here. It takes the alpha array as its input parameter

public static  int[] doubleArray(int [] alpha){

This declares beta of 20 integers

   int[] beta = new int[20];

This populates beta by 2 * alpha[i]

<em>    for(int i = 0;i<20;i++){</em>

<em>        beta[i] = 2 * alpha[i];</em>

<em>    }</em>

This returns the alpha array

   return beta;}

The copyAlphaBeta array is defines here

public static int[] copyAlphaBeta(int [] alpha, int [] beta){

This declares AlphaBeta as 10 elements

   int [] AlphaBeta = new  int[10];

This populates the first 5 elements of AlphaBeta with the first 5 of alpha

<em>    for(int i = 0;i<5;i++){</em>

<em>        AlphaBeta[i] = alpha[i];</em>

<em>    }</em>

   int count = 5;

This populates the last 5 elements of AlphaBeta with the last 5 of beta

<em>    for(int i = 15;i<20;i++){</em>

<em>        AlphaBeta[count] = beta[i];</em>

<em>        count++;</em>

<em>    }</em>

This returns the AlphaBeta array

   return AlphaBeta;

}

The printArray is defined here. It takes the alpha array as its input parameter

public static void printArray(int [] alpha){

This iterates through alpha array

   for(int i = 0;i<20;i++){

This prints each element of the array

       System.out.print(alpha[i]+" ");

A new line is started after the 15th element

<em>        if((i+1)%15 == 0){</em>

<em>            System.out.println(" ");</em>

<em>        }</em>

   }

}

See attachment for complete program which includes the main

Download txt
4 0
2 years ago
A must decode this code. I guess is not a Cesar. The last line is a email adress.
Pie
It is a text in Polish language.
Powiedz nam w czym jesteś dobry

Magento
Drupal
DjangoSymfony
Python
PHP
Zaznaczone?
Teraz wyślij formularz z konsoli przeglądarki:

require('jquery')[WON'T TRANSLATE THIS LINE BECAUSE IT IS IMMORAL-> YES, I AM A PROGRAMMER :)) ]



3 0
3 years ago
Which of the following is true about ISO___________.
Svetach [21]

Answer:

The answer is "Option d".

Explanation:

In the given question in option b and option c, there is some typing mistake, but all the options are correct.

ISO is an organization, that is based on Geneva, which is a member of Switzerland. It provides one of the major guidelines for developing entities, that provides technical suggestions on frameworks for data communication.

  • It is used to optimize products with businesses across ranges.
  • The primary aim was to facilitate trade, but in several ways, it focus on enhancing procedures, safety, and quality.
3 0
3 years ago
Other questions:
  • When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
    6·1 answer
  • Which one of the following features can control left and right indents on using markers
    8·1 answer
  • The _____ establishes that the destination device is present on the network, verifies active service, and informs the destinatio
    13·1 answer
  • An automated service that consolidates and distributes information from newsgroups, blogs, forums and news websites is called
    11·1 answer
  • Can someone please please please help me!
    10·1 answer
  • Compare Fibonacci (recursion vs. bottom up)
    12·1 answer
  • Match the desired outcome to the appropriate action.
    6·1 answer
  • In which drawer can you set certain lights to light up on your micro:bit?
    12·2 answers
  • Who Likes K-pop? Which group or groups do you like
    12·2 answers
  • Project Description:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!