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
elena-s [515]
3 years ago
15

Is_sum_odd that takes a non-negative integer number as parameter and returns true if the sum of individual digits is odd, false

otherwise.
Computers and Technology
1 answer:
lara31 [8.8K]3 years ago
6 0
Make sure that you understand how addDigits( number, base ) works!

```
#!/usr/bin/python

import sys


def addDigits( number, base ):
    if( number ):
        return( addDigits( number // base, base ) + ( number % base ) )
    else:
        return( 0 )


def wrapper( number, base=10 ):
    if( ( addDigits( number, base ) ) % 2 ):
        return True
    else:
        return False


if( __name__ == "__main__" ):
    if( len( sys.argv ) != 2 ):
        sys.stderr.write( "usage: " + sys.argv[ 0 ] + " <integer>\n" )
        exit( 127 )

    print wrapper( int( sys.argv[ 1 ] ) )
```

You might be interested in
What is the output of the following code segment?
Aliun [14]

Answer:

o

Explanation:

8 0
2 years ago
The lcm of two numbers can be equal to the smallest number in the set. true false
jarptica [38.1K]

Answer: False

Explanation:

8 0
3 years ago
Read 2 more answers
How do I change the year I was born on this website? I made a mistake and now I can't fix it. Can somebody please help me?
Eddi Din [679]

Answer:

you can go to settings and try to fix it or contact the people of this website

Explanation:

8 0
3 years ago
Why should computers have a file structure? For organization For storing code To prevent viruses To keep back-ups of files
AURORKA [14]

Answer: I believe the answer to your question is  For organization I hope this helps!  

8 0
2 years ago
While ________ is centered on creating procedures, ________ is centered on creating objects. Procedural programming, class progr
AlexFokin [52]

Answer

Procedural programming, Object-oriented programming

Explanation

Procedural programming is a type of computer programming language that specifies a series of well structured steps and procedures  within its development period of time. It contains a systematic order of statements, functions and commands to complete a computational task or program. It is centered on creating procedures. While object oriented programming is a programming language that is centered on creating objects rather that actions and data rather than logic.. It has four principles which are inheritance, polymorphism, abstraction and Encapsulation


4 0
3 years ago
Other questions:
  • Which of the following activities can cause data to be damaged or lost?
    7·1 answer
  • Why is a DNS cache poisoning attack dangerous? Check all that apply. A. Errrr...it's not actually dangerous. B. It allows an att
    12·1 answer
  • Karen has opened a new business and is using Google Display Ads to build awareness of her new products. How does Google Display
    6·1 answer
  • Which of the following describe a required
    7·1 answer
  • Top/bottom rules allows user to apply conditional formatting cells that fall within the top or bottom numbers or percentile. how
    7·1 answer
  • What is a central location that houses Joint Information System (JIS) operations and where public information staff perform publ
    6·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • Do you watch markiplier?
    13·2 answers
  • 1. Write an expression whose value is the result of converting the str value associated with s to an int value. So if s were ass
    12·1 answer
  • A(n) ____ describes the structure, content, and access controls of a physical data store or database.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!