Question

Week 10 - Pob 1[Lists] / 1. POD 1: Data bounded Instructions Today we will carry on looking at lists. You will be given a lis
5 points pc MW data: (11,2,3,41 threshold: 3 data: [121,22,443, 4, 217] threshold: 100 data: 199,11,83,22,77,33, 66, 44,551 t
pod.py textfilel.txt textfile2.txt textfile3.txt New I Full S. 2 # CSCI 1105 3 # Week 9, POD 3 (Loops & lists) 4 # @author: ?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Refer to the code below:

def greater_than_threshold(li, threshold):
    # Iterating in loop
    for i in li:
        # checking if threshold is greater than the value on list
        if i > threshold:
            # printing value
            print(i)
# This is the function which you can append in your code at the top

# Driver Code
print("Enter list:")
# taking list as input with comma seperated values
li = list(map(int, input().split(',')))
# taking threshold as input
threshold = int(input("Enter threshold value: "))
# Calling function for output
greater_than_threshold(li, threshold)

# This is how you call the function passing your list in place of li and your threshold value in place of threshold

Output:-

Enter list:
11,2,3,4
Enter threshold value: 3
11
4

Enter list:
121,22,443,4,217
Enter threshold value: 100
121
443
217

Enter list:
99,11,88,22,77,33,66,44,55
Enter threshold value: 50
99
88
77
66
55

==============================================

Please Refer to the images below:-

1 Edef greater than threshold(li, threshold) : # Iterating in loop = for i in li: # checking if threshold is greater than theEnter list: 11,2,3,4 Enter threshold value: 3 11 4

Enter list: 121,22,443,4,217 Enter threshold value: 100 121 443 217

Enter list: 99,11,88,22,77,33,66,44,55 Enter threshold value: 50 99 88 66

======================================

Please Upvote, Thank You

======================================

Add a comment
Know the answer?
Add Answer to:
Week 10 - Pob 1[Lists] / 1. POD 1: Data bounded Instructions Today we will carry...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PoD 4: Greetings all around! Instructions Good day! Bonjour! Good evening! Bonsoir! You are in a...

    PoD 4: Greetings all around! Instructions Good day! Bonjour! Good evening! Bonsoir! You are in a bilingual country! A nice thing to know is how to greet people in any language. You are going to write a program to make sure that we know how to greet the peoples around us. The French word "Bonjour" means "Good day. This is greeting can be used from morning until dusk (let's 18:00 or 6pml. After dusk we might say "Bonsoir" or "Good...

  • Instructions We will carry on working with functions! Once more, all input and output has been...

    Instructions We will carry on working with functions! Once more, all input and output has been taken care of for you. All you need to do is finish off the function tableMin that finds the minimum value within a table (2-D list). Details Input Input has been handled for you the list has been populated. It reads in N as well as the data needed to fill an NxN integer table. Processing Complete the tableMin function. Note that you have...

  • //LinkedList import java.util.Scanner; public class PoD {    public static void main( String [] args )...

    //LinkedList import java.util.Scanner; public class PoD {    public static void main( String [] args ) { Scanner in = new Scanner( System.in ); LinkedList teamList = new LinkedList(); final int TEAM_SIZE = Integer.valueOf(in.nextLine()); for (int i=0; i<TEAM_SIZE; i++) { String newTeamMember = in.nextLine(); teamList.append(newTeamMember); } while (in.hasNext()) { String removeMember = in.nextLine(); teamList.remove(removeMember); }    System.out.println("FINAL TEAM:"); System.out.println(teamList); in.close(); System.out.print("END OF OUTPUT"); } } =========================================================================================== //PoD import java.util.NoSuchElementException; /** * A listnked list is a sequence of nodes with...

  • C++ You're given the pointer to the head nodes of two linked lists. Compare the data...

    C++ You're given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they are equal. The lists are equal only if they have the same number of nodes and corresponding nodes contain the same data. Either head pointer given may be null meaning that the corresponding list is empty. Input Format You have to complete the int CompareLists (Node headA, Node* head B) method which takes...

  • Can you make simple code of this using C++ In-lab Final Exam Ideas: Following are the possible topics for the in-lab final exam for next week. These all assume that we have: struct Node int data...

    Can you make simple code of this using C++ In-lab Final Exam Ideas: Following are the possible topics for the in-lab final exam for next week. These all assume that we have: struct Node int data; Node 'pNext; and in main we have: Node "pHead = NULL; // pointer to the head of the list Node·pTemp: // Used to get new nodes Node "pHeadA NULL: Node "pHeadB = NULL; We will also provide for you the code that is used...

  • Using c 3 File Input & Data Processing Reading data from a file is often done in order to pro...

    using c 3 File Input & Data Processing Reading data from a file is often done in order to process and aggregate it to get ad- ditional results. In this activity you will read in data from a file containing win/loss data from the 2011 Major League Baseball season. Specifically, the file data/mlb_nl_2011.txt contains data about each National League team. Each line contains a team name fol- lowed by the number of wins and number of losses during the 2011...

  • In the lectures about lists we have seen some Python code examples that involve the processing of...

    In the lectures about lists we have seen some Python code examples that involve the processing of lists containing weather statistics. The original source of the values shown in the slides was taken from part of the Environment Canada website that serves up historical data: http://climate.weather.gc.ca/historical_data/search_historic_data_e.html    Data can be provied by that website using the Comma Separated Value (CSV) format which is stored in text files normally using a CSV suffix. We will not work directly with such files in...

  • 1. The Cool Clothing Company is developing a new computer order processing system to process mail...

    1. The Cool Clothing Company is developing a new computer order processing system to process mail order sales of its products. Customers send in their orders, by email, together with a credit card payment. Availability of the ordered goods is then checked in an inventory file; then the validity of the credit card payment is checked online to customer's bank. If these two checks are successful, a dispatch paid order is sent to the customer and warehouse. The warehouse is...

  • In this lab you will convert lab5.py to use object oriented programming techniques. The createList and...

    In this lab you will convert lab5.py to use object oriented programming techniques. The createList and checkList functions in lab5.py become methods of the MagicList class, and the main function of lab6.py calls methods of the MagicList class to let the user play the guessing game.                              A. (4pts) Use IDLE to create a lab6.py. Change the 2 comment lines at the top of lab6.py file: First line: your full name Second line: a short description of what the program...

  • In Python Question 3 (13 points): Purpose: To practice your ability to modify lists and compute...

    In Python Question 3 (13 points): Purpose: To practice your ability to modify lists and compute with lists of lists Degree of Difficulty: Moderate For this question, you are given some population estimates, by age group, from Statistics Canada for some provinces. Starter File a5q3 starter.py is a file that contains a list of lists, to which the variable Pop-data refers, which represents 2020 population numbers. The first item in Pop_data is a list whose first item is the string...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT