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
marshall27 [118]
3 years ago
15

Input a double and print the first two digits after the decimal point with a space between them. Sample run: Please input a deci

mal number: 57.8934 Answer: 8 9 Hint - to complete the second coding activity in lesson 5 you had to learn how to get individual digits from an int value. You can reuse this method once you convert the user input to an appropriate int value (you will need both multiplication and casting for this).
Computers and Technology
1 answer:
Kruka [31]3 years ago
7 0

Answer:

number = float(input("Please input a decimal number: "))

number = int (number * 100)

second_digit = number % 10

first_digit = int(number / 10) % 10

print("Answer: " + str(first_digit) + " " + str(second_digit))

Explanation:

Ask the user to enter a decimal number (number = 57.8934)

Multiply it by 100 (number = 5789.34) and typecast to int (number = 5789)

Use the module to get the second digit (9)

Divide the number by 10 (578.9), typecast to int (578) and use module operator to get the first digit (8)

Print the numbers as requested

You might be interested in
Any fact or set of facts, such as the words in a letter to a friend or the notes in a song, can become computer ____.
Alina [70]

I think the answer is... data

3 0
3 years ago
How to do the for loop in python
shusha [124]

Answer:

To loop through a set of code a specified number of times, we can use the range() function, The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.

Explanation:

hope this helps

8 0
2 years ago
1 There are several applications to assist you to surf through the internet, mention
prohojiy [21]
Email
Web browsing
Peer-to-peer services
3 0
3 years ago
What is one step taken when solving a computer software problem?
k0ka [10]
Properly scanning the computer and deleting any viruse. this is Answer

Some of the feedback I hear from new developers working on a programming problem revolves around uncertainty of where to start. You understand the problem, the logic, basics of the syntax, etc. If you see someone else’s code or have someone to guide you, you can follow along. But maybe you feel uncertain about doing it yourself and have trouble turning your thoughts into code at first even though you understand the syntax or logic. Here’s my process and some tips to tackling a sample problem that hopefully some of you may find helpful in your journey.
HOME







Some of the feedback I hear from new developers working on a programming problem revolves around uncertainty of where to start. You understand the problem, the logic, basics of the syntax, etc. If you see someone else’s code or have someone to guide you, you can follow along. But maybe you feel uncertain about doing it yourself and have trouble turning your thoughts into code at first even though you understand the syntax or logic. Here’s my process and some tips to tackling a sample problem that hopefully some of you may find helpful in your journey.


3 0
3 years ago
Read 2 more answers
When 2 or more computers are connected it is called?
Alenkasestr [34]

When two or more computers are connected it is called Local Area Network (LAN).

5 0
3 years ago
Other questions:
  • Which of the following characteristics relates to authentication header (AH)? It is a document that defines or describes compute
    11·1 answer
  • Urgent help<br> Write a program that prints ‘Hello World’ to the screen
    8·1 answer
  • A word that has a specific, predefined meaning in a programming language is called
    8·1 answer
  • Which of the following is not true about designing classes? In order for class information to be printed instead of a memory add
    12·1 answer
  • Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N
    10·1 answer
  • Amy just added a 462 meter run of fiber optic cable to the network what should she do next?
    10·1 answer
  • The first and second numbers in the Fibonacci sequence are both 1. After that, each subsequent number is the sum of the two prec
    6·1 answer
  • Please help me. Adnan also wants to add a photograph of a bridge. It is on another PowerPoint presentation that is open in a dif
    11·1 answer
  • Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not
    10·1 answer
  • If I use the command right(90), which way will Tracy turn?<br> If correct I mark brainlist
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!