i’d like to give a row of bulk numbers and print their 10% (*0.1): 1000 2000 3500 print results –> 100 200 350 Do i do this basic example with Python? Any suggestion appreciated Source: Python..

#### Category : loops

Beginner question: I am trying to iterate over the lists and return each item to send to another list. I can only get it to return the last item in each list- 4 & ‘home’. What am I doing wrong? def help(): alist = [1, 2, 3, 4] blist = [‘bob’, ‘is’,’not’, ‘home’] for event ..

I apologize if this has been asked before, but I can’t seem to find a more thorough explanation. I am trying to web-scrape a real-estate website (i.e. multiple URLS –> multiple pages –> multiple internal href links inside each page). How would I efficiently create a for loop? Someone pointed out I should make a ..

I have this simple linear regression solution, where changing variable z I get linear reg. coefficients and equation for 3 different species, however each time changing z manually is not a solution and cannot be integrated in a automated code. Currently I am filtering species (1.0 – birch; 2.0 – lime; 3.0 – oak) with ..

I don’t understand what am I doing wrong here, I’m a new programmer. I want to download all these links file, but in the end I’m only getting in Download one last link file fo14NOV2020bhav.csv.zip. My Code – headers = {‘Referer’:’https://www1.nseindia.com’} def download_url(url, save_path, chunk_size=128): r = requests.get(url, stream=True,headers=headers) with open(save_path, ‘wb’) as fd: for ..

There is a given list of lists of integers that represent a 2- dimensional grid with n rows and m columns. A cell is called a dominant cell if it has a strictly greater value than all of its neighbors. Two cells are neighbors when they share a common side or a common corner, so ..

I have a dict with values like this (coordinates = [cx1, cx2, cy1, cy2]): > co_list = [ { "data.01": [ 6.9490666, 47.4897206, 7.0073678, 47.5169333 ] }, { "data.02": [ 6.9493157, 47.4627392, 7.0075872, 47.4899521 ] } ] from an user input I got a list with 4 coordinates (bbox = [bx1, by1, bx2, by2]) bb_list ..

I can’t seem to figure out why my program does not loop correctly when I run it and enter " -1, 4.6, then -1 again" it loops when I enter -1 repeatedly or anything else outside the range. MIN_GRADE = 0.0 MAX_GRADE = 4.3 grade = float(0.0-4.3) while (grade <= MIN_GRADE): grade = float(input("Enter your ..

everyone. I need to show "Determinate loop" and "Indeterminate Loops" on this code. (nested) This is a simple code, pick a random number, and gives you 2 opportunities to guess the number, if you can’t, it will let you know what the magic number was and start the game again. questions: is there any other ..

I am trying to evaluate an integral using the trapezoidal rule for a range of n = 2^p where p= [1,2…20], to produce different values for the integral. I have tried to implement a for loop to define n and h however I get a TypeError:’list’ object cannot be interpreted as an integer. Is there ..

## Recent Comments