Question

PYTHON Im stuck, this is one line of code but I just cant remember it... Please Help! Thank YOU! LIST COMPREHENSION Create a python list, that stores exactly [0,hi, 2, thi, 4, thi, 6, hi, 8, thi) using python list comprehension. You c

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The required line of python souce code is given below:

myList = [(i, j) for i, j in zip([x*2 for x in range(5)], ["hi" for x in range(5)])]

The screenshot of the above source code is given below:

myList [(i, j) for i, j in zip([x*2 for x in range (5)], [hi for x in range (5))))

The above statement will store the list as per the given requirement.

Add a comment
Know the answer?
Add Answer to:
PYTHON Im stuck, this is one line of code but I just cant remember it... Please...
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
  • PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP!...

    PYTHON this implementation is really hard, Im stuck especially with the requirements they give. PLEASE HELP! THANK YOU! RECURSIVE! Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python list of integers, the above function will return True if lissy is sorted in decreasing order, otherwise it will return false. For example, print(check_Decreasing Order([100,50,8, -2])) True print(check_Decreasing_Order([108,50,8,2,35])) False Implementation Requirements: 1. Your implementation must be recursive. 2. If you need more parameters, you may define...

  • PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules! Give...

    PYTHON please help! im stuck on this homework question, THANK YOU! please follow the rules! Give a recursive python implementation of the following function: def check_Decreasing_Order(lissy): Given lissy, a python list of integers, the above function will return True if lissy is sorted in decreasing order, otherwise it will return false. For example, print(check_Decreasing Order([100,50,8, -2])) True print(check_Decreasing_Order([108,50,8,2,35])) False Implementation Requirements: 1. Your implementation must be recursive. 2. If you need more parameters, you may define new functions or helper...

  • PYTHON I need help with this Python problem, please follow all the rules! Please help! THANK...

    PYTHON I need help with this Python problem, please follow all the rules! Please help! THANK YOU! Bonus Question Implement an efficient algorithm (Python code) for finding the 11th largest element in a list of size n. Assume that n will be greater than 11. det find 11th largest numberlissy Given, lissy, a list of n integers, the above function will return the 11th largest integer from lissy You can assume that length of lissy will be greater than 11....

  • PYTHON please help, stuck on this output and memory image! THANK YOU! Q3 7 Points import...

    PYTHON please help, stuck on this output and memory image! THANK YOU! Q3 7 Points import copy list1 = [11, [22, 33], [44, 55], 66] list2 = list1 list3 = listi[:] list4 = copy.deepcopy(listi) list1[0] = 100 list1[1][1] = 300 list1 += [77] list2 = list2 + [88] print(listi) print(list2) print(list) print(list) Please write output of the above program below (in the text box) and upload a picture of memory image? Enter your answer here Memory Image: Please select file(s)...

  • PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU!...

    PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU! Implement an efficient python function for the following: def find_Number_of_A11_Possible_Ways(matrix, totalGasAmount): The above function will count all the possible paths from top left cell to bottom right cell of a matrix using exactly totalGasAmount. Each cell of this matrix has a nonnegative number which represents gas amount of that cell. The constraint is that from each cell, you can either move right or move...

  • PYTHON: Im stuck here, big O notation and runtime. What is it and Why are they...

    PYTHON: Im stuck here, big O notation and runtime. What is it and Why are they those? Please look at the pic, need help as Im confused. Thank You! def method3(n): for i in range(n): for j in range(100): for k in range(n): print(i+j+k) What is the runtime (tightest/closest bound in terms of O) for the above python function (method 3)? Please briefly explain. Enter your answer here def method4(n): for i in range(n): for j in range(n, o, -2):...

  • PYTHON Im kinda stuck here for this question, could use some help! Python please, and please...

    PYTHON Im kinda stuck here for this question, could use some help! Python please, and please follow the requirements. 09 5 Points Al and Bob are arguing about their algorithurs. Al claims his Oinlogn time method is always faster than Bob's O(n^2)-time method. To settle the issue they perform a set of experiments. To Al's dismay, they find that if n < 100 the On/2)-time algorithm runs faster and only when na 100. O(nlog n)-time one runs faster. Explain how...

  • I am stuck with this coding problem from edx coding python 4.4.6: #This is a long...

    I am stuck with this coding problem from edx coding python 4.4.6: #This is a long one -- our answer is 20 lines of code, but #yours will probably be longer. That's because it's one of the #more authentic problems we've done so far. This is a real #problem you'll start to face if you want to start creating #useful programs. # #One of the reasons that filetypes work is that everyone #agrees how they are structured. A ".png" file,...

  • Im stuck. can someone please show me code on how i can make text appear on...

    Im stuck. can someone please show me code on how i can make text appear on html canvas. i want to create a form where someone for example put their name and when submit button is clicked on the form it appear on the canvas. i am using html javascript. please show code for javascript, canvas, and html. please let me know if im not making sense. Thank you

  • I need help with this code, I'm stuck on it, please remember step 4, I'm very...

    I need help with this code, I'm stuck on it, please remember step 4, I'm very much stuck on that part. It says something about putting how many times it appears Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...

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