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
Nana76 [90]
3 years ago
5

The function below takes two parameters: a string parameter: csv_string and an integer index. This string parameter will hold a

comma-separated collection of integers: ‘111, 22,3333,4’. Complete the function to return the indexth value (counting from zero) from the comma-separated values as an integer. For example, your code should return 3333 (not ‘3333 *) if the example string is provided with an index value of 2. Hints you should consider using the split() method and the int() function. print.py 1 – def get_nth_int_from_CSV(CSV_string, index): Show transcribed image text The function below takes two parameters: a string parameter: csv_string and an integer index. This string parameter will hold a comma-separated collection of integers: ‘111, 22,3333,4’. Complete the function to return the indexth value (counting from zero) from the comma-separated values as an integer. For example, your code should return 3333 (not ‘3333 *) if the example string is provided with an index value of 2. Hints you should consider using the split() method and the int() function. print.py 1 – def get_nth_int_from_CSV(CSV_string, index):
Computers and Technology
1 answer:
irakobra [83]3 years ago
3 0

Answer:

The complete function is as follows:

def get_nth_int_from_CSV(CSV_string, index):

   splitstring = CSV_string.split(",")

   print(int(splitstring[index]))

Explanation:

This defines the function

def get_nth_int_from_CSV(CSV_string, index):

This splits the string by comma (,)

   splitstring = CSV_string.split(",")

This gets the string at the index position, converts it to an integer and print the converted integer

   print(int(splitstring[index]))

You might be interested in
If Chris has a car liability insurance, what damage would he be covered for
andrezito [222]

Automobile liability insurance covers damage that Chris would do to other people’s property.

Liability insurance is a type of insurance that covers the other person, it does not covered the insured person. This insurance would cover items like damage to someone else’s car or their personal property.

6 0
3 years ago
Brianna is taking a backpacking trip in the wilderness and wants to back up the photos from her camera. Which type of storage de
Katen [24]

Answer:

<u><em>C</em></u>

Explanation:

Flash drives usually have an input (E.G. one of those android charger connectors), so just plug that into your camera, and load the flash drive with the photos. Then go home and plug the USB on the flash drive into your PC. If there isn't already, a folder will be made in your "Pictures" folder on your PC, to which you can open the folder, and then your photos should be there. From there you can open them, print them, etc.

Hope this helped, and sorry if I didn't answer in time.

6 0
3 years ago
write a while loop that reads integers from input and calculates integer finalnum as follows: if the input is divisible by 5, ad
ira [324]

The while loop for the program that reads integers from input and calculates integer is illustrated thus:

#include <iostream>

using namespace std;

int main()

{

//declaring the variables

int userInput;

int outputVal;

outputVal = -19;

//take user input

cin >> userInput;

//take user input until negative input is given

while(userInput > 0)

{

 //if the input is divisible by 5, subtract the

 //input divided by 5 from outputVal

 if(userInput%5==0)

     outputVal -= userInput/5;  

 //if the input is not divisible by 5, add the

 //input multiplied by 5 from outputVal

  else

     outputVal += userInput*5;

   cin >> userInput; // take input

}

//print the output value

  cout << "Output value is " << outputVal << endl;

return 0;

<h3>What is a while loop?</h3>

A while loop is a control flow statement in most computer programming languages that allows code to be performed repeatedly based on a supplied Boolean condition. The while loop is similar to a looping if statement.

A "While" Loop is used to iterate over a certain block of code until a condition is met. If we wish to ask a user for a number between 1 and 10, we don't know how many times the user may enter a larger number, so we keep asking "while the number is not between 1 and 10."

Learn more about program on:

brainly.com/question/22654163

#SPJ1

7 0
1 year ago
My messaging system is messed up. It keeps saying I'm getting messages but then it says nothing new in my inbox. I'm confused- H
denpristay [2]

Answer:

hey! that happens to me too!

Explanation:

tbh i just think its whenever you comment on something and someone answers, that appears... but i could be wrong.

lol :)

4 0
3 years ago
Read 2 more answers
create 2 text field web form where 1 field allows the user to specify the text spring to search for and the other field allows t
mixas84 [53]

Answer:

<?php

$error = '';

$string = "This is a sample string. Hello World";

if(isset($_POST["modify_str"])){

$show_form = false;

extract($_POST);

// check that user entered some value

if(empty($string_search)){

$error += 'Please fill out the string to be searched for <br>';

$show_form = true;

}

// check that user entered some value

if(empty($string_replace)){

$error += "Please fill out the string/word to be replaced for <br>";

$show_form = true;

}

// if user has entered some value, then replace it in the string using the str_replace function and print the string after modification

if (!$show_form){

$string = str_replace($string_search, $string_replace, $string);

echo "String after modification: <br>";

echo $string;

}

}

else

{

$show_form = true;

}

if($show_form)

{

?>

Please select any word to search for and replace for in the following string <br>

<?php echo $string; ?>

<br> <br>

<form action="" method="post">

<label for="string_search"> String to search for: </label>

<input type="text" name="string_search" id="string_search" required="required" /> <br> <br>

<label for="string_replace"> Replace with: </label>

<input type="text" name="string_replace" id="string_replace" required="required" /> <br> <br>

<input type="submit" id="modify_str" name="modify_str" value="Modify String"/>

</form>

<?php

}

?>

Explanation:

The program was written with php.

It is designed such that it can create 2 text field web form where 1 field allows the user to specify the text spring to search for and the other field allows the user to specify the replacement string.

See answer for the program code.

6 0
3 years ago
Other questions:
  • What impacts the types of logs and events logged on a server?
    14·1 answer
  • program that reads numbers from scanf (keyboard) and then sums them, stopping when 0 has been entered. Construct three versions
    14·1 answer
  • How do you plan to keep your personal and professional connections and activity seperate on various social media platforms?
    15·1 answer
  • 8. When requesting a review of a denied claim, it is required to send a _______________ with the claim.
    10·1 answer
  • You can change the size of text using which block of code?
    11·1 answer
  • Write a program that asks the user how many numbers will be entered and then has the user enter those numbers. When this is done
    7·1 answer
  • Do you think that dealing with big data demands high ethical regulations, accountability, and responsibility of the person as we
    7·1 answer
  • A list is sorted by selecting the largest element in the list and swapping it with the last one. This technique is called ______
    7·1 answer
  • Why is it necessary to have a w-2 or 1099 form when using tax preparation software?
    13·1 answer
  • What is e banking effects
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!