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
marin [14]
2 years ago
10

Write a program to input a number.Find the sum of digits and number of digits

Computers and Technology
2 answers:
BaLLatris [955]2 years ago
8 0

Answer:

<em>#Sum of Digits</em>

a = int(input("Enter a number: "))

sumofdigits = sum(int(dig) for dig in str(number))  

print("Sum of digits: ", sumofdigits)

<em># Number of digits</em>

count = 0  

print ("Total number of digits : ",len(str(abs(a))))

Explanation:

It is pretty self-explanatory however, I will tell it to you anyways. So, the sum of digits iterates to each digit and adds them up. For the number of digits, it uses in-built functions (length, string and absolute)

ki77a [65]2 years ago
7 0

omg a computer program

i love it

okay so i will assume taht you want the program to be in python

here we go

a = int(input("Enter a number ")

b = int(input("Enter another number ")

sum = a + b

def Digits(sum):

count = 0

while sum != 0:

sum //= 0

count += 1

return count

print(f"Sum is {sum} \nnumber of digits are {Digits(sum)}")

You might be interested in
Summarize why understanding the differences between surface culture and deep culture may inform your knowledge, skills, and prof
lorasvet [3.4K]

Answer: By understanding the basic cultural values of the individual such as looks and talk. Also understanding the core values of the individual such as attitude, beliefs and religion. It would improve the behavior in your professional and cultural relationship with individuals in your workplace.

Explanation:

8 0
2 years ago
Objectives ** WILL GIVE BRAINIST PLEASE**
mamaluj [8]

Answer:

of which std this question is

8 0
2 years ago
Read 2 more answers
A(n) ____ is a computer that requests and uses network resources from a(n) ____.
Crazy boy [7]

A(n) client exists a computer that requests and utilizes network resources from a(n) server.

<h3>What is a computer network?</h3>
  • A computer network is a collection of computers that share resources that are available on or provided by network nodes.
  • The computers communicate with one another via digital links using standard communication protocols.
  • These links are made up of telecommunication network technologies that are based on physically wired, optical, and wireless radio-frequency means and can be configured in a variety of network topologies.
  • Nodes in a computer network can be personal computers, servers, networking equipment, or other specialized or general-purpose hosts.
  • They can be identified by network addresses and have hostnames.
  • Local-area networks (LANs) and wide-area networks (WANs) are the two basic network types.
  • A(n) client exists a computer that requests and utilizes network resources from a(n) server.

To learn more about computer network, refer to:

brainly.com/question/8118353

#SPJ4

6 0
10 months ago
Describe a situation in which you have experienced harm as a consequence of a failure of computer security. Was the failure mali
Andrei [34K]

Answer: The goals of computer security are to protect computers and users from data theft or loss as well as damage to any part of the computer.

Explanation: Common means of achieving computer security are firewalls, anti-virus software and this can fail due to hardware problems  or   weaknesses that prevent malicious attacks.

To answer this question, think of a time when you experienced any one of these. For example, personally, I was once an unfortunate victim of a general malicious attack that took advantage of a weakness in my anti-virus software. After clicking on a link on a dodgy website, a virus was installed on my computer. My computer finally crashed, without any hope of restarting it. I lost all my data and I had to buy a new computer.  This was a malicious attack.

However, sometimes people can be specifically targeted to steal their data or monitor their activities.  

8 0
3 years ago
Students who understand what the teacher is saying do not need to take notes.
padilas [110]
Trueeeeeeeeeeeeeeeeee
6 0
3 years ago
Read 2 more answers
Other questions:
  • 3. If B3=6 and D5=8, what would the following function return? IF(B3&gt;D5, "Closed", D5-B3) *
    10·2 answers
  • You have just driven to the Hewlett-Packard site in Corvallis to field-interview a programmer. You sit down in a conference room
    6·1 answer
  • Which Supreme Court case resulted in a decree issued for the Michigan Department of Corrections to provide female inmates access
    10·1 answer
  • You may save more money by using a a0 service, but you will spend more time on creating a contract.
    12·1 answer
  • "A(n) ___________ is a radio transceiver that plays the same role as a hub or switch in a wired network and connects the WLAN to
    14·1 answer
  • Componets of computer
    5·1 answer
  • What should you rely on to determine when to change your oil? a. Oil color b. 6,000 miles since the last oil change c. Owners ma
    7·1 answer
  • When compared to traditional desktop customers, why are mobile phone users much more likely to book a room or airline reservatio
    12·1 answer
  • List the types of infrared we have
    12·1 answer
  • Use your editor to open the cc_data.js file and study the data stored in the staff object to become familiar with its contents a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!