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
nasty-shy [4]
3 years ago
15

Write code to complete print_factorial()'s recursive case. sample output if user_val is 5: 5! = 5 * 4 * 3 * 2 * 1 = 120

Computers and Technology
1 answer:
maxonik [38]3 years ago
5 0
```
#!/usr/local/bin/python3


import sys

def print_factorial( user_val ):
    if( user_val < 1 ):
        return( 1 )
    else:
        return( print_factorial( user_val - 1 ) * user_val )


if( __name__ == "__main__" ):
    if( len( sys.argv ) == 2 ):
        print( print_factorial( int ( sys.argv[ 1 ] ) ) )
    else:
        sys.stderr.write( "usage: %s <integer>\n" % sys.argv[ 0 ] )

    exit( 0 )
```

You might be interested in
Analyze the following code (in both cases number has been declared and initialized): Code 1: boolean even; if (number % 2 == 0)
shusha [124]

Answer:

Both codes are correct.The value of even is true when the number is even.

Explanation:

Code 1:

number %2 ==0 means that when dividing number by 2 is the remainder coming out is zero.If it is true then even becomes is true if it is false then else statement is executes in which even becomes false.Means the number is odd.This code is simple and easy to understand.

Code 2:-

This code is a bit tricky and takes time to understand.even becomes true

when the number is divisible by 0 and false when it is not.

8 0
3 years ago
Derek has an interest in designing video games. What requirements should he fulfill to be a game designer? To be a game designer
4vir4ik [10]

Answer:

2. Marketing, communication or advertising

Explanation:

5 0
2 years ago
There are___standard colors for text in a theme.
Stella [2.4K]
There are two standard colors for a text in a them
6 0
3 years ago
____ twisted pair is the least quality twisted pair wire that should be used in a data/voice application.
xxMikexx [17]

Answer:

Category 5 (Cat 5) twisted pair is the least quality twisted pair wire that should be used.

Explanation:

The reason is as follows:

  1. Category 1 twisted pair is not suitable for transmitting data but comes in handy for telephone communications. Hence, it should not be used in a data/voice application.
  2. Category 2 twisted pair is suitable for data transmission, however, it can only transmit at 4Mbps which is very slow. Hence, it should not be used in a data/voice application.
  3. Category 3 twisted pair can transmit data with speed reaching 10Mbps which is slow for voice/data communication.
  4. Category 4 twisted pair can transmit data with speed reaching 16Mbps and is used in token ring networks. It is slow for communicating in a voice/data application.
  5. Category 5 twisted pair is the least qualified to be used in a voice/data application because it can transmit data at speeds that reach 100Mbps.

Hence, Cat 5 or Category 5 twisted pair is the least quality twisted pair that should be used in a data/voice application.

6 0
3 years ago
You decide to use a packet sniffer to identify the type of traffic sent to a router. You run the packet sniffing software on a d
Alecsey [184]

Answer:

Promiscuous mode

Explanation:

6 0
2 years ago
Other questions:
  • Compare and contrast how the roles of women and men in society are changing​
    14·1 answer
  • What is the software that manages and controls the activities and resources of the computer? O The CPU The OS The ALU The GUI D
    13·1 answer
  • Which note-taking method quickly captures and organizes information?
    9·2 answers
  • If none of the contacts of a manual switch change status when the operator is activated, what is the most probable cause?
    9·1 answer
  • An indication of delayed fuel ignition could be​
    5·1 answer
  • Design and implement an algorithm that gets a list of k integar values N1, N2,...Nk as well as a special value SUM. Your algorit
    10·1 answer
  • Please answer the following in python: Answering the ones that have #TODO
    14·1 answer
  • What are the specifications for a mine shaft headgear ​
    10·1 answer
  • How will technology help people with disabilities become more transportation independent?.
    5·1 answer
  • How to transfer polygon from eth to polygon in ledger live
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!