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
ch4aika [34]
3 years ago
13

Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For

example, if the user enters 2.718, the program prints: Integer part = 2 and decimal part = .718 in python
Computers and Technology
1 answer:
svp [43]3 years ago
7 0

Answer:

Explanation:

The following was coded in Python as requested. It is a function that takes in a number as a parameter. It then uses the Python built-in math class as well as the modf() method to split the whole number and the decimal, these are saved in two variables called frac and whole. These variables are printed at the end of the program. The program has been tested and the output can be seen below.

import math

def seperateInt(number):

   frac, whole = math.modf(number)

   print("Whole number: " + str(math.floor(whole)))

   print("Decimals number: " + str(frac))

You might be interested in
Is a protocol that allows users to log on to and access a remote computer?
kompoz [17]
The answer is yes I hope this help ya out

6 0
3 years ago
The objects that you place on master pages are called _____.
Studentka2010 [4]
The answer to this is A.
3 0
3 years ago
After correctly configuring a new wireless enabled thermostat to control the temperature of the company's meeting room, Joe, a n
ZanzabumX [31]

Answer:

The WPA2 shared key is incorrect is the correct answer.

Explanation:

The WPA2 shared key is incorrect because when the technician installs a new wireless thermostat for the purpose to control the temperature of the meeting room. Then, admin determines that the thermostat is not connecting to the control system through the internet and the admin authenticate that its parameter of receiving thermostat is associated with the AP. So, that's why the following option is correct.

8 0
3 years ago
1. What is the Internet?
3241004551 [841]
A place to watch daisy Taylor vids
8 0
3 years ago
Read 2 more answers
A cracked tone ring will often cause what type of problem?
emmainna [20.7K]
A cracked tone ring will often cause, False ABS actuation at low speed.
3 0
3 years ago
Other questions:
  • Select the correct answer.
    8·2 answers
  • The term ________ refers to the use of a single unifying device that handles media, internet, entertainment, and telephone needs
    13·1 answer
  • Replmon is the first tool you should use when troubleshooting Active Directory replication issues. State True or False.
    12·1 answer
  • Dora electronically transferred $591.68 from her checking account to Matt's checking account. In what column of the check regist
    14·2 answers
  • When you set the position property for a block element to fixed, the element
    5·1 answer
  • Use the following global structure declaration as an example only. You will need to create your own data structure based on a da
    5·1 answer
  • Jack is an accountant. He can't access the spreadsheet software, which is installed on the server. What should Jack do?
    5·2 answers
  • Drag the correct type of update to its definition.
    13·1 answer
  • Difference between statement x=+5 and x+=5​
    7·1 answer
  • A radio and communications security repairer is responsible for both radio and satellite communication systems.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!