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
densk [106]
3 years ago
14

Which code causes a ValueError? int('4') 3 / 0 int('four') 3 / 2.0

Computers and Technology
1 answer:
Sliva [168]3 years ago
8 0

Answer:

Option 3: int('four') is the correct asnwer

Explanation:

ValueError occurs in Python when we try to store wrong content in the datatype or conversion.

For example, if we try to store a string in integer datatype.

From the given options,

int('four') will produce a ValueError because "four" is a string and cannot be converted to integer data type.

Hence,

Option 3: int('four') is the correct asnwer

You might be interested in
Write a program that asks the user to enter a series of numbers separated by commas. Here is an example of valid input: 7,9,10,2
alex41 [277]

Answer:

Here is the JAVA program. Let me know if you need the program in some other programming language.

import java.util.Scanner; // used for taking input from user

public class Main{ //Main class

public static void main(String[] args) {//start of main() function body

  Scanner scan = new Scanner(System.in); // creates a Scanner type object

   String input; // stores input series

    int sum = 0; //stores the sum of the series

    System.out.println("Enter a series of numbers separated by commas: "); //prompts user to enter a series of numbers separated by comma

     input = scan.nextLine(); //reads entire input series

     String[] numbers = input.split("[, ]"); //breaks the input series based on delimiter i.e. comma and stores the split sub strings (numbers) into the numbers array

   for (int i = 0; i < numbers.length; i++) { //loops through each element of numbers array until the length of the numbers reaches

          sum += Integer.parseInt(numbers[i]); } // parses the each String element of numbers array as a signed decimal integer object and takes the sum of all the integer objects

     System.out.println("Sum of all the numbers: " + sum);  } } //displays the sum of all the numbers

Explanation:

The program prompts the user to enter a series separated by commas.

Then split() method is used to split or break the series of numbers which are in String form, into sub strings based on comma (,) . This means the series is split into separate numbers. These are stored in numbers[] array.

Next the for loop iterate through each sub string i.e. each number of the series, converts each String type decimal number to integer using Integer.parseInt and computes the sum of all these integers. The last print statement displays the sum of all numbers in series.  

If the input is 7,9,10,2,18,6

Then the output is: 7+9+10+2+18+6

sum = 52

The program and its output is attached.

8 0
3 years ago
Given the following Area class, how would I call the calcAreaSquare method in AreaTest.java with square with side length of 6? p
Olin [163]

Answer:

You can call the static method using the following statement:

double area = Area.calcAreaSquare(3.5);

Explanation:

In  Java, a static method can be called by directly using the Area class name and followed with a dot syntax as shown above. This will invoke the calcAreaSquare() method and act on the input 3.5 and return the output to the variable area.  

Calling a static method doesn't need to go through a class instance.  

3 0
4 years ago
January 19/May 16 2022
fenix001 [56]

Answer:

This should get you started. Many things could be improved. You could keep adding layers to this program if you wanted to, so I wrote it with that in mind.

The new salary depends on the employee's department and current salary. I created a class that represents each employee. The function looks at the employee's current salary, and looks up what the employee's department raise will be (using the dictionary/hash table) before performing the calculation.

3 0
2 years ago
What action makes RAM on your computer disappear?
aliina [53]

Use Windows Task Manager & Resource Monitor. The easiest way to free up RAM in use is to open Windows Task Manager. Navigate to the Processes tab and then sort the list of open programs by memory. This will reveal any process that's consuming an unusually large volume of RAM.

3 0
4 years ago
Read 2 more answers
Technician A states that a tap handle has a right-angled jaw that matches the squared end that all taps have. Technician B state
Elena L [17]

Answer:

Technician A and Technician B are correct

Explanation:

Based on the information provided within the question it can be said that both Technician A and Technician B are correct. A tap handle's right-angled jaw allows many different taps to be attached for different types of situation to more comfortably and conveniently handle that situation. Such as a T-shaped tap in order to cut a thread in an awkward space as Technician B has stated.

3 0
3 years ago
Other questions:
  • Element will you include to present numerical data on the slide
    13·1 answer
  • Translate each of the following binary representations into its equivalent base ten representation.
    7·1 answer
  • A) Suppose a computer has an instruction pipeline with 4 phases. How many cycles (if there are no delays) would it take to compl
    13·1 answer
  • What is radio frequency identification used for
    6·1 answer
  • Authentication is a mechanism whereby unverified entities or supplicants who seek access to a resource provide a label by which
    12·1 answer
  • A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in
    15·1 answer
  • Can you answer this question?
    9·1 answer
  • PLZ HELP!! How does HTML help solve the problem of telling a computer what a web page looks like, not just the content that is o
    15·1 answer
  • What are some real-life situations where multi-dimensional arrays might be useful?
    8·1 answer
  • The base position for your fingers to be placed on a keyboard is called<br> 2 point
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!