565 Posted Topics

Member Avatar for oberlin1988

This is a quick and easy way to check if a word is palindrome. [CODE]''' Created on Feb 20, 2012 @author: sin ''' def lff(file): line = open(file).read().splitlines() for i in range(0, len(line)): if str(line[i]).lower() == str(line[i]).lower()[::-1]: print "'" + str(line[i]) + "'", "is palindrome." else: print "'" + str(line[i]) …

Member Avatar for Lucaci Andrew
0
3K
Member Avatar for Mxlfa

and your question is?... It is for the best possibly to post some of your code as well, so that we know something relating to this error...

Member Avatar for Lucaci Andrew
0
259
Member Avatar for new2pyp

use this instead [code] path=raw_input("Path: ")+'.txt' x=1000 with open(path, 'rb') as fileobj: ... [/code]

Member Avatar for ihatehippies
0
185
Member Avatar for Lucaci Andrew

So, even thou I have searched throughout the forums, I couldn't get a clear answer, maybe perhaps I'm a noob @ Python. As a beginner, I don't know much about Python, and it's frustrating to search the net and not find the actual answer. So, I'm working on this project, …

Member Avatar for Lucaci Andrew
0
321
Member Avatar for Netcode

have you tried this version of PIL? [url]http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil[/url] it's for windows 64. I had some similar problems with my PIL, having my OS on 64 and that library on 32 bits... Duno...

Member Avatar for Lucaci Andrew
0
200
Member Avatar for knnchau

perhaps it is better if you use [code]int(raw_input:)[/code] than [code]int(input:)[/code] input already returns the integer value, there's no need for an int in front of the input, but if you want to use raw_input, and still use the value as an integer, you must use int(raw_input). From the latest versions …

Member Avatar for knnchau
0
200
Member Avatar for python-noob

Maybe this will help you: [code] filename='name.txt' fh = open(filename, 'r') line = open(filename).read().splitlines() for ln in line: print ln """ My output: Neuman, Alfred E. Stevenson, Robert Lewis Lewis, C.S. Doe, Jane Bush, George Herbert Walker """ [/code] It should handle middle names with no problem, I guess...:D

Member Avatar for ihatehippies
0
247
Member Avatar for stannum

[COLOR="Red"]Please use an adequate posting using the [B][ code][ /code][/B] tags.[/COLOR] [B]Stannum post:[/B] [code]#include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> void hangman(int ); int display(char [], int&); int input(char [], char&, int , int); int l; void main() { clrscr(); int n,pos=0, s=0 ; char num[50],ch, M [][50]={ "oman holiday","breakfast at tiffany's", …

Member Avatar for WaltP
0
293
Member Avatar for scott_liddle

I've look into your assignment and I've come up with a possible module. I'll post the code below, and an attachament with the .txt containing the positions. Please, report me if there were any bugs inside the program, 'cose I'm a noob @ Python, and I don't want to miss …

Member Avatar for Lucaci Andrew
0
174
Member Avatar for Bauke

I don't think that you have there a nested list. [code]regels = ['Auto','Brandstof auto',' tinq ',' shell ',' tank s ',' dap ',' slump oil ','q8 ','brand oil',' bp lemmer '], ['Huishouden','Boodschappen',' poiesz ',' spar ','super de boer','c 1000',' aldi ',' albert heyn ','breimer ',' keurslager',' bakkerij '] [/code] Here …

Member Avatar for Bauke
0
147
Member Avatar for Lucaci Andrew

I have this code, it's basically a program which I wrote, a 'Guess my number' game. The only problem is that I did something, and now I can't choose from my options anything else, that the first option. I put all my conditions in the while True loops, and now …

Member Avatar for Lucaci Andrew
0
616
Member Avatar for philipalex

A way to do this is with dictionaries, so that you can store your values from the sequential file. You will have then the key and the values. For more information about dictionaries, visit [url]http://docs.python.org/library/stdtypes.html#dict[/url] , or read the Python Manual which came with your installer, or the online Python …

Member Avatar for philipalex
0
232
Member Avatar for spyhawk

Ok, so I've looked over your assignment, and I've come up with this. I don't know if it really helps you, but here goes. [CODE]''' Created on Feb 15, 2012 @author: sin ''' import Image, ImageDraw #As a first thing, you must have the third party graphics libraries. #You can …

Member Avatar for Lucaci Andrew
0
262
Member Avatar for Lucaci Andrew

[CODE]def prel(x, i, j): if (i < j - 1): k1 = (j - i + 1) / 3 k2 = 2 * k1 prel(x, i, i + k1) prel(x, i + k1 + 1, i + k2) prel(x, i + k2 + 1, j) for k in range(i, j): …

Member Avatar for Lucaci Andrew
0
229
Member Avatar for pmishra

How about Approximately 217.000.000 results(0,26 seconds)... And I found some websites...

Member Avatar for thehelios
0
145

The End.