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
igomit [66]
3 years ago
12

PYTON CODERS I NEED HELP I WILL GIVE BRAINLIEST!!! Why is this python code giving me problems?

Computers and Technology
1 answer:
NARA [144]3 years ago
4 0

Answer:

num3 = float(input('Insert a decimal: '))

num3 = round(num, 2)

print(f"You rounded decimal is: {num3}")

Explanation on why this works:

This block of code resembles a decimal from user input and round it to its nearest 10th. Let me explain the flaws in the original:

>>> num3 = int(input("Please input a decimal number:")

On this line of code you put it as the user input will be transferred to an int when in reality it should be a decimal float so we can round it later in the program. so it should be:

>>> num3 = float(input("Insert a decimal: "))

Second Line of code:

>>> num3 = int(round(num3, 2))

In this case, the int() function is not needed. so just remove and its good.

Lastly you used:

>>> print("your rounded decimal is: ", x)

Which is perfectly fine. Two more ways to output the same thing is by using:

>>> print(f"You rounded decimal is: {num3}")

Or just use the format() string method:

>> print("You rounded decimal is: {0}", num3)

You might be interested in
A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac
denpristay [2]

Answer:

import java.util.Scanner;

public class LabProgram {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int inputYear;

       boolean isLeapYear;

       isLeapYear = false;

       inputYear = scnr.nextInt();

       // If a year is divisible by 400,  then it is a leap year

       if (inputYear % 400 == 0)

           isLeapYear = true;

       // If a year is divisible by 100,  then it is not a leap year

       if (inputYear % 100 == 0)

           isLeapYear = false;

       // If a year is divisible by 4,  then it is a leap year

       if (inputYear % 4 == 0)

           isLeapYear = true;

       if(isLeapYear)

           System.out.println(inputYear + " is a leap year.");

       else

           System.out.println(inputYear + " is not a leap year.");

   }

}

Explanation:

If a year is divisible by 400,  then set the boolean isLeapYear to true. If a year is divisible by 100,  then set the boolean isLeapYear to false. If a year is divisible by 4,  then set the boolean isLeapYear to true.

Check if isLeapYear is true, then print that it is a leap year. Otherwise, print that it is not a leap year.

Output:

1712

1712 is a leap year.

5 0
3 years ago
Read 2 more answers
You want your computer to boot off of the network and have the ability to be brought out of sleep mode over the network. Which t
notsponge [240]

The two technologies should be implemented in the BIOS are PXE and WOL

<h3>What is the term above about?</h3>

WOL is known to be a term that connote that which is often used to put on (power on) and PXE is known to be a term that is often used for turning (booting) that is when one wants to load an OS from a remote server.

Conclusively, Note that  WoL often occurs before PXE and as such, he two technologies should be implemented in the BIOS are PXE and WOL.

Learn more about technologies  from

brainly.com/question/25110079

#SPJ1

4 0
2 years ago
Which property do you use to align an element horizontally with the left or right edge of its parent element?
Ugo [173]
A thank me later:) give me hearts
3 0
3 years ago
I have to make a online presentation, which program is the best
LiRa [457]
If you want an online presentation, I think you mean by a website.
Best thing you can find is Google Slides.
if you want a program,
LibreOffice is your best bet. It is completely free and it is for Linux, Windows and possibly Mac.
4 0
3 years ago
Read 2 more answers
Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task
jolli1 [7]

Answer: I belive transitions

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following statement: ptrMemberVarType objectThree(objectOne); The values of the member variables of objectOne are b
    10·1 answer
  • True or False?
    8·1 answer
  • ENG103 DISCUSSION BOARD 5
    12·1 answer
  • What type of maintenance is required of a computer’s power supply to ensure that it remains in working order?
    15·2 answers
  • 1. Why is it important for IT technicians to keep documentation on computers for which they are
    13·1 answer
  • By
    7·1 answer
  • . The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8
    12·1 answer
  • What is the answer to 4.9 Code Practice: Question 2
    14·1 answer
  • The main work area of the computer is the
    14·2 answers
  • In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set M
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!