15,190 Topics
![]() | |
I have written the following code to return True if the list has any repeating elements and False ow [CODE]def has_repeats(L,newlist = None): if newlist == None: newlist = [] if len(L) == 0: return False if L[0] in newlist: return True else: newlist.append(L[0]) has_repeats(L[1:],newlist)[/CODE] It is not returning True … | |
I tried searching around, but I don't understand exactly what I'm looking for so it could very well exist already and I just don't know how to ask the search engines about it. I apologize in advance. Thus the question mark on the thread title. My current background of programming: … | |
Hello everyone, I have been working on a python script to help assign university students to workplace placements. The problem is that for a given group of students there are only a limited amount of places and each placement location can only caters for a few students. The ideal solution … | |
Hello everyone! I am taking a python course at my college and I have recieved a question for my homework that I am having trouble with. [I]14) Write a program that finds the average of a series of numbers entered by the user. As in the previous problem, the program … | |
Hi - I'm a rookie programmer. Could somebody explain how I can append a nested list of the form: List = [[Name1,[Detail-1,Counter-1],[Detail-2,Counter-2].....] [Name2,[Detail-1,Counter-2],[Detail-2,Counter-2].....] ................................................. ] My code is : def program(List, Name, Detail): for entry in List: if entry[0] == Name: entry[1].append([Detail,Counter]) return [B][I] List.append ([Name,[Detail]]) for entry in index: … | |
I don't know which langauge code it is written(but i think it is python) but i am just posting to know what can happen by the following code snippet. Here is the code:- # # ms12-020 "chinese shit" PoC # # tested on winsp3 spanish, from localhost # # import … | |
Hi all, my Professor has asked us to solve this problem, which is a Midterm Practice problem for our up and coming Midterm exam, which is on Monday. I am wondering if I'm doing this the correct way or not. [B][U]Here is this question the problem asks:[/U][/B] Problem 19 Random … | |
I have made a cipher substitution program which would take some input and print a coded output. however,the required output is not coming. My program first asks for input.then it converts it into a list as it is mutable.ALso,a string of all the alphabets is declared too. [CODE] #cipher code … | |
I have to write a program that will print the chain of a number using a hailstone function, as well as with a range of numbers. That part of my program works perfectly but I cant figure out how to write a function that will find and hold the number … | |
I can't figure out what the problem is or how to rewrite my code to fix it. Basically I'm trying to create an Adventure game heavily influenced by the game Zork. The game presents you with some options and then you input your choice. I'm trying to account for a … | |
Hi, I am trying my hands on lambda function and here is my code. [CODE]>>> a = [1,2,3,4] >>> b = [17,12,11,10] >>> map(lambda x,y:x+y, a,b)[/CODE] And the output is : [CODE] < map object at 0xb7540eec >[/CODE] So my question is why this map object output? Why not actual … | |
How do i convert the list ['T','h','i','s',' ', 'i','s'] to ['This','is'] | |
I wrote code to rotate the image 90 - 180-45 But how can I rotate the Image at different angles : 20 or 80 or 155 ..... Etc. in jython | |
Tried to add two images on each other But the problem is because I have two images are merged in a gradual Which means that: to show the first picture on top and clear and the second picture is not visible Then gradually start Image Alathanih Baldhor to disappear Image … | |
Hi guys, i have a tricky problem with this wxgtk gui and thread nesting. As you can see i'm trying to collect data through a buffer ( self.data= dict() ) through the main gui. I need to get the data from the ComboBox and the three textfields then i need … | |
I've been running a python script successfully on Linux for about a month. Recently, I got a message that says "can not execute", "No such file or directory". I can type python and it runs on command line, but my script will no longer run on the daemon. It has … | |
Hi all. My new job involves writing scripts for people in other departments. I'm pretty much on my own with this and I'm still a beginner with Python(I think my brain is still in PHP mode and I'm still struggling with this object oriented approach). Here is what I have: … | |
Hello, I need help to get all together. Pls see 2 different codes below . 1 code: Represents format for final result paper called "vysvedcenie" (evaluation) for a particular student. code: [CODE]def do_once(f): f() def do_twice(f): f() f() def do_four(f): do_twice(f) do_twice(f) def hlavicka(): print 'x',' '*40+'VYSVEDCENIE'+' '*46+'x' def vertikal(): … | |
Does anyone here have any experience of the notebook widget in PythonCard? I can't figure it out and it is missing from the docs... Thanks. | |
Hi, I created a numpy matrix(1 row, 3 cols) with the following values [4 6 8]. What I want to do is to concatenate all these values into a single entry of binary values. So instead of [4 6 8] I would want to have a numpy matrix of just … | |
Firstly, this is homework for my computing science class, but we are allowed to get help on the internet or using any other way we want. I'm trying to write a program to read in a file with user responses to questions (I.E. an automated handset vote) and then to … | |
hi. i am writing a program in python and i need two things will be processed simultaneously but because i have a lot of global variables i can n't do it with parallel python library. i tried multiprocessing and Multithread too but nothing find yet. can someone suggest me a … | |
This snippet explores the change of a hexadecimal (base 16) string to a denary (base 10) integer and the reverse. Interestingly Python allows the representation of the hexadecimal string in two different forms. For instance 255 can be changed to 'FF' (also 'ff') or '0xff'. Any of these hexadecimal strings … | |
Hi everyone! I have a quick question. Is there any way i can update python package for cygwin manually? The setup.exe which handles cygwin installation and updates, prompts me to update the whole cygwin installation to 1.7.x but i would like to keep using the older version (1.5.25). I only … | |
1 23 456 7891 23456 plz give the code by using while loop................ | |
I have a question about h5py. I've read almost all of the tutorials online but I must be missing something. I'm wanting to read data from an h5 file that already exists. Here is the first part of the file as it looks from being h5dump'ed just so you can … | |
hey i want to put two values into one dict and am not sure how to achieve this. i want it to look like this. what am trying to do is a dictionary that holds the date as the key, and a dictionary as its value. That dictionary will contain … | |
I've been working on this code all night and i can't seen to find out how to do the math i think it needs a loop of some kind on line 17 and 18 also it wont print out the avg mpg please help def main(): 1 print("This program calculates … | |
the project is about a debate, and there are 4 candicates in the debate, and we need to group them into 4 different dict and count the word frequence they said. the debate is line by line, and we should group the sentences by name tage, like PAUL: and then … | |
Hello everyone, I have to code an array that in each row, it has 16 columns! So I called it myself a 17 dimensional array but I was wondering what data sturcture in Python can best represent this keeping in mind that, it should be easily addressable and modifible. For … |
The End.