I am an amateur python programer with 2 months of experience. I am trying to write a GUI to-do list through tkinter. The actual placement of the buttons are n
I've got an assignment in which I need to code a recursive function (with no loops) in python that returns: [[]] if n is 1 [[],[[]]] if n is 2 [[],[[]],[[],[[]]
Lets say I have 2 lists: L1 = [2,4,1,6] L2 = [1,5,2,3] The output should be a new list that contains the biggest numbers found in L1 or L2 based on their pos
I have a list: my_list = [1, 2, 3, 4, 5] How can I multiply each element in my_list by 5? The output should be: [5, 10, 15, 20, 25]
Where can I find the list of GCR public images? In case of docker images, we can list it in hub.docker.com. But I couldn't find anything like that for GCR.
Getting error: myFile.write(item+"\n") TypeError: unsupported operand type(s) for +: 'int' and 'str' and not sure why. Where shall I add the int? This i
I have a vocabulary V = ["anarchism", "originated", "term", "abuse"], and list of words test = ['anarchism', 'originated', 'as', 'a', 'term', 'of', 'abuse', 'fi
I applied machine learning algorithm with caret package (caretlist) to predict death in a cohort of patients according to multiple variables (e.g. age, gender,
I need to make recodings to data sets of the following form. # List elements of varying length set.seed(12345) n = 1e3 m = sample(2:5, n, T) V = list() for(i
Input: [1, 2, 3] [a, b] Expected Output: [(1,a),(1,b),(2,a),(2,b),(3,a),(3,b)] This works, but is there a better way without an if statemen
I am trying to reproduce the following functions created in Python in R. # Python def square_area(side): return side * side results = [] for i in range(1
I'm trying to figure out to convert a list to a linked list. I already have a class for the link but I'm trying to figure out how to convert a list to linked l
How to return False if all elements are in a list are False? The given list is: data = [False, False, False]
eList = [] while True: eDict = { "ID": "", "NAME": "", "EMAIL": "", "ADDRESS": "", "SALARY": ""} try:
I have some code in the general form: variable "foo" { type = "list" default = [ 1,2,3 ] } resource "bar_type" "bar" { bar_field = "${var.foo}" } I wa
I use a nested for loop to get data of Weekdays. If one of the days is 'null' the loop stops at that day and doesn't get the rest of the days. I believe that I
I am trying to write a function in Scheme and Prolog that returns first, middle and last item of a list. E.g., find([4,5,8,7,9],L), L = [4,8,9]. I came up with
I was storing a list with elements [0, 1, 2, 3, 4, 4] When I iterated through it and printed each element's index, my output was something like this: 0 1 2 3 4
I was following along with a react-beautiful-dnd tutorial that uses react component classes instead of hooks. I was writing an equivalent program with modern re
I am trying to fetch a list from API that is two methods fetchImages and fetchCategories. the first time it is showing a red screen error and then after 2 secon