15,175 Topics

Member Avatar for
Member Avatar for markusd5454

Please provide a pseudocode algorithm for this question please. Please do the pseudocode for Python 3.2.2 Write a program which asks the user to enter a username, and then a password. Then when they type the command “log off”, they will have to retype their username and password in order …

Member Avatar for TrustyTony
0
155
Member Avatar for JOSED10S

printBoard: A call to this function with printBoard(5,4,[1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) would print the following output to standard output: |-----------| | 1 0 0 1 0 | | 0 0 0 0 0 | | 0 0 0 0 0 | | 0 0 0 0 0 | |-----------| def board(l,h,list): %a length, …

Member Avatar for JOSED10S
0
201
Member Avatar for Tadmir

So I have a number of CSV files with 6 columns of numbers in each file. I would like to perform a few operations (multiplication, division etc.) on each column in each of the CSV files using Python and instead of opening each file manually, I want to add the …

Member Avatar for TrustyTony
0
2K
Member Avatar for markusd5454

Write a program which asks the user to enter a username, and then a password. Then when they type the command “log off”, they will have to retype their username and password in order to log back on again. Please note i am using python 3.2.2. Regards Mark

Member Avatar for ihatehippies
0
81
Member Avatar for moroccanplaya
Member Avatar for moroccanplaya
0
1K
Member Avatar for roe1and

Hi. I am a beginner with Python. I've done some PHP work in the past but I suspect this is not helping with my progress in Python. I have a text file that basically looks like this: [CODE]a=1 b=2 c=3 a=4 b=5 c=6 a=7 c=8 a=9 b=0 c=11[/CODE] At the …

Member Avatar for roe1and
0
305
Member Avatar for Jetster3220

I am really struggling with a Python classes project. Here are the directions Design and implement a class called Dog that contains attributes (data) representing the dog’s name and age. Define the Dog constructor to accept and initialize that data. Include one method that will reset the dog’s age, one …

Member Avatar for Gribouillis
0
229
Member Avatar for straylight

So I have been working on Pascal's triangle and going about it a different way then most. I am attempting do to a series of if and elif statements to check for the values in rows and columns of those rows. However my novice skills in python are stopping me …

Member Avatar for straylight
0
236
Member Avatar for KickAssElmo

Please tell me what I'm doing wrong. I have a list, and I want python to make a file out of it. [CODE]def changename(filename, modifier): return filename[:4]+modifier+filename[-4:][/CODE] [CODE]def fileWrite(filename, ext, sortedList): openthis =open(okfilename(changename(filename,'_'+ext)),'wb') for item in sortedList: openthis.write(item) openthis.write('\n') return[/CODE] [CODE]lastnames.append(newNames) lastnames.sort() print '\n'.join(lastnames) names.close() fileWrite(filename, "Last-sorted", lastnames)[/CODE]

Member Avatar for KickAssElmo
0
231
Member Avatar for Yoink

I have to write a program that will decode a Ceasar cypher with any possible rotation length on a long string that will be imported into the program. I'm trying to figure out some pseudo coding on how I want to tackle this problem but there is one key thing …

Member Avatar for TrustyTony
0
350
Member Avatar for SnehalBPatil

I am developing the Django application which runs the Matlab code and create some txt and png files on the server.when I run these below python command on server, it works fine but when I try to run from the server (it is coded in Viewspy).It shows file is updated.(from …

0
173
Member Avatar for jxj123

hi, my code involves something like this: [I]IP = "123.123.123.123" string = "Your IP is %s and it's 100% correct" % IP[/I] The IDLE thinks the second % is a operator and I don't know how to make it as a regular text. please help.

Member Avatar for jxj123
0
96
Member Avatar for HoneyBadger

Guys I have this string: [CODE]mystring = 'blue, pink, red, red, red, white, long, short, blonde, blonde'[/CODE] I want to: 1.) Split it into a list, 2.) Erase all duplicates 3.) Sort it out alphabetically so I did this: [CODE]mystring = list(set(mystring.split(', '))).sort()[/CODE] But why when I go to call …

Member Avatar for HoneyBadger
0
123
Member Avatar for HoneyBadger

Guys I'm looking for a clean way of splitting a string into a list: I have this: [CODE]myString = 'blue, red, pink, purple'[/CODE] and I want this: [CODE]myString = ['blue', 'red', 'pink', 'purple'][/CODE] How do I do that?

Member Avatar for HoneyBadger
0
154
Member Avatar for layneb131

Im trying to write a program that inputs a single letter and prints out the corresponding digit on the telephone. Im having trouble finding out a way in which you can group the variables that have the same digit, but im not sure how. You guys have any suggestions? P.S. …

Member Avatar for woooee
0
483
Member Avatar for ohblahitsme

So I have a function called start() and it has multiple if statements and I want all of them to run. [code=python] def start(): print """You have just woken up from a very long nap. You find yourself in a dimly lit cave. There is a patch of light in …

Member Avatar for woooee
0
281
Member Avatar for dineshswamy

[CODE] a = input("enter the string") print "%s dinesh" %l m=re.match(r'(.*)(\.*)',l,re.I) print m.group() print m.group(2) [/CODE] i m getting the following error ,when i give input [CODE] Traceback (most recent call last): File "regularexp.py", line 1, in <module> a = input("enter the string") File "<string>", line 1, in <module> NameError: …

Member Avatar for dineshswamy
0
133
Member Avatar for floatingshed

With a lot of help from ihatehippies I got threads working yesterday. Now I need to stop 'em! More specifically I want to stop a second thread starting until the first has finished.. This is what I have in my threading class at the moment: [CODE]class ProcessThread(Thread): """Test Worker Thread …

Member Avatar for floatingshed
0
372
Member Avatar for darsha

[QUOTE]i am trying to implement a fitness function for GA. i got a code written in python. i don't have any idea about python. can someone help me to convert it into java the code is here [/QUOTE] [CODE]# there are many ways to do an eigenvalue decomp, this is …

Member Avatar for FALL3N
0
568
Member Avatar for theLured

Hello, I'm a python beginner and glad I joined this forum :). I'm wanting to make a simple program where the window is hidden for x seconds/minutes and is then shown again. My problem is that using time.sleep() causes the Hide() function to not run until after time.sleep() is complete. …

Member Avatar for ihatehippies
0
2K
Member Avatar for kavithabhaskar

I am looking at a source code There is a class called A and it has a parameter in its _init_ function called. Class A self.id = id There is another class called B and has a parameter in its __init__ function called Class B self.ide = ide There's an …

Member Avatar for inuasha
0
116
Member Avatar for minimee120

Hi all. I have an up and coming midterm, and this is one of the practice problems. All's I need to do is draw a Tic-Tac-Toe board in TURTLE. However, it has to be in a loop, or something, and I am having a difficult time putting it into one. …

Member Avatar for minimee120
0
162
Member Avatar for xopenex

Hello all, I found a thread similar, but it was closed... so here is the code and my question... I am wondering how to change the code from creating files to creating variables? this is the code from the thread on here.... and below it is the code that i …

Member Avatar for TrustyTony
0
198
Member Avatar for jone kim

I want to explain my code to you. 1. this code is to search for the given number whether it is present in the list or not. 2. first if statement returns the value of row if the i/p number is in the first column 3. if the given number …

Member Avatar for jone kim
0
239
Member Avatar for breatheasier

Hi, I'm wanting my program to loop and create different files outputting at different stages in a while loop, I just can't work out how to make it happen! here's a stupid example [code=python] while (a<10): a = a+1 if (a=4) or (a=6): output = open('output'+a, 'w') #something like this? …

Member Avatar for xopenex
0
5K
Member Avatar for Eclipse77

Hi, I'm in need of some help in using functions for the hangman game. The professor doesn't understand how difficult it is for a first time programmer and just doesn't explain new concepts thoroughly. The game that I'm trying to code looks like this: Enter the secret word: LETTERS ------------------------------------------------------------ …

Member Avatar for woooee
0
3K
Member Avatar for 47pirates

I have a server in python and client in java and i want to share images through the socket how can i do so? help plz

Member Avatar for dantinkakkar
0
167
Member Avatar for arindam31

Hi , I want to achieve something like this . Consider the example [CODE]>>> txt 'arin.thearc@gmail.com' if '@' or '.' in txt: do something[/CODE] I just want to know how can we nest ORs and ANDs inside the if or while loops...

Member Avatar for TrustyTony
0
215
Member Avatar for vlady

hi! I have another struggle. I'd like to have this kind of output: [COLOR="Green"]som object studenta: Janko Mrkvicka som object predmetu: fyzika, mam znamky: [4, 1] a priemer: 2,5[/COLOR] How can I make it? my output is a bit different (it is in last line): [COLOR="Red"]som object studenta: Janko Mrkvicka …

Member Avatar for Lucaci Andrew
0
132
Member Avatar for Thropian

I started looking into networking and storing/altering data on a computer. I've got everything running, but can't get it to work from an outside computer. Is there an easy way to get past the LAN restrictions or am I going to have to change settings on my router?

Member Avatar for ihatehippies
0
291

The End.