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
ElenaW [278]
2 years ago
5

2.4 Code Practice: Question 2

Computers and Technology
1 answer:
klasskru [66]2 years ago
8 0

num = float(input("Enter a number: "))

num1 = int(num)

print(num - num1)

I hope this helps!

You might be interested in
Question 6 Which of the following statements about datasets used in Machine Learning is NOT true? 1 point Testing data is data t
Inessa [10]

Answer:

Training data is used to fine-tune the algorithm’s parameters and evaluate how good the model is

Explanation:

The statement about datasets used in Machine Learning that is NOT true is "Training data is used to fine-tune algorithm’s parameters and evaluate how good the model is."

This is based on the fact that a Training dataset is a process in which a dataset model is trained for corresponding it essentially to fit the parameters.

Also, Testing the dataset is a process of examining the performance of the dataset. This refers to hidden data for which predictions are determined.

And Validation of dataset is a process in which results are verified to perfect the algorithm's details or parameters

4 0
3 years ago
15
iVinArrow [24]

I believe that the answer is A: Extension but I am not 100% sure, hope this helps.

7 0
3 years ago
Read 2 more answers
A company that manufactures machine parts order a new system that makes Products at ten times the speed of earlier machines. the
Semmy [17]
D i think hope this helps
7 0
3 years ago
Read 2 more answers
When studying an information system, illustrations of actual documents should be collected using a process called _____.
Oliga [24]
<span>When studying an information system, illustrations of actual documents should be collected using a process called sampling. Correct answer: D
</span>This process systematically selects representative elements of a population with the goal to get representative and useful information about the population as a whole and it is useful when <span>data sets that are too large to efficiently analyze in full.</span>
6 0
3 years ago
Assume the variable myWord references a string. Write a statement that uses a slicing
givi [52]

Answer:

"myWord[-5:]"

Explanation:

So whenever you slice a string, the syntax in python is expressed as:

string[a:b:c]

where a=start index (this is included in the sliced string)

b = end index (this is excluded from the sliced string)

c = increment

If any of these are included, they are set to default values, where a=0, b=len(string), and c=1.

The increment isn't necessary here, and it's just so you know the syntax a bit more

Anyways, I'm assuming when the question asks to display "the last 5 characters in the string" it means in order? e.g "abcdefghijk" -> "ghijk" and not "abcdefghijk" -> "kjihg"

The last piece of information to know is what a negative index represents.

For example if I have the piece of code

"

string = "hello world"

print(string[-1])

"

This will output "d", and the negative 1 represents the last letter. If you did -2, it would output the 2nd to last letter and so on.

So to print the last 5 characters, we simply use the -5 as the starting index.  

"

string = "hello world"

print(string[-5:])

"

This will print "world" or in other words, the last 5 letters. The reason for this is because the -5 in the first spot means the starting index is the 5th to last letter, and when you have the : after the -5, this is the way of telling python you're slicing the string, and not indexing 1 character. You don't need to include another value after that, because it will default to the last index of the string, or more specifically the last index + 1, since the last index is still included.

So the last thing to know, is that if the string isn't greater than 5 characters, it just prints the entire string, and no errors are raised. You can test this out your self as well. So whenever you have a string that's less than 5 characters the entire string is outputted.

3 0
1 year ago
Other questions:
  • The Active Directory Users and Computers tool can be used to:______.
    11·1 answer
  • If data from a DOS system is electronically sent to an EHR or other Windows-based system via an interface to populate an indexed
    7·1 answer
  • 2 (01.01 LC)
    5·1 answer
  • Moore's Law postulates that:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this t
    6·1 answer
  • Hich of these statements is a value statement?
    14·2 answers
  • Your secondary servers have not been able to contact your primary server to synchronize information. How long will the secondary
    12·1 answer
  • Do you remember your first 3D movie experience? What was the movie, what was the experience like, and why was it memorable? (If
    7·1 answer
  • PLEASE HELP! :)
    14·1 answer
  • What are the parts of a file?​
    9·1 answer
  • Which two peripherals are not required to browse the internet?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!