15,175 Topics

Member Avatar for
Member Avatar for The_Tiger

Hi everyone, I really need help to make the below code calculate the numeric value for each name separately. for example: if i enter "Williams smith", it will calculate the first name and give its value alone and calculate the second name and give its value too. the code right …

Member Avatar for Tech B
0
121
Member Avatar for ohlermsu

I am in desperate need of help with a python 2.7 project I am working on. I am really struggling in the class and they messed up my tutoring appointment for tonight so I have no one to help me. I am doing a project that reads a .csv file …

Member Avatar for Stefano Mtangoo
0
213
Member Avatar for NickSchade

Dear, kind python experts, I'm quite new to this program having only started 2 days ago, but the program I want appears to be relatively simple and I've managed to copy most of the important code from other examples. In a nutshell, I want to 1) Open a txt file …

0
30
Member Avatar for effBlam

Im trying to change this modified blackjack game to where there is no computer. A choice of either two or three players is asked with three cards dealt instead. How can I i change this current code to 1) prompt user for either 2 or 3 players(no computer), 2) have …

Member Avatar for TrustyTony
0
212
Member Avatar for effBlam

Im having a main function issue. My program is a text analyzer of more than several lines and then input 'END' to stop taking input. It analyzes input text based on the chosen options 1 through 2, relooping for invalid choice. Im having an issue having it properly work in …

Member Avatar for Greeky
0
223
Member Avatar for eikonal

Hi there, I've got a little script which is not working nicely for me, hope you can help and find the problem. I have two starting files: traveltimes: contains the lines I need, it's a column file. The lines I need are separated by a line which starts with 11 …

Member Avatar for Gribouillis
0
166
Member Avatar for dilbert_here00

Hello ALL, I was wondering if there is a way to run a python program at windows startup, without running the script as a windows service? I have a python program which runs a bunch of functions & then sometimes restarts the computer. At startup I want my script to …

Member Avatar for dilbert_here00
1
5K
Member Avatar for peste19

I have a list for example list = ['a','b','c','d'] and i give and i want to give the letters in the list numeric value for example a=2,b=1,c=4,d=3 i want to display the list like this list = ['a','b','c','d'] but than i wanted to do a sum(list) and get a value …

Member Avatar for snippsat
0
121
Member Avatar for cwilli23

The US uses a progressive approach to income taxes. Tax rates for 2011 (for singles) are 10% taxable income from 0 to $8,500 15% over $8,500 to $34,500 25% over $34,500 to $83,600 28% over $83,600 to $174,400 33% over $174,400 to $379,150 35% over $379,150 There are also a …

Member Avatar for woooee
0
187
Member Avatar for Gobble45

Hello everyone at DaniWeb, this is my first post here, so please correct me, if i am wrong in asking this question. Firstly, i had a 10minute search amongst Google, and here at Daniweb. But im not entirely sure what to search for. So my question. i have a Python …

Member Avatar for Gobble45
0
920
Member Avatar for oberlin1988

I want to randomize a range of numbers without "random.shuffle." Instead it would be using "randint(0, n-1)" If I put in 4 into the function it could return [1,3,2,0] or [3,1,0,2]. I know that starting with an empty list and running through with a while list would work.

Member Avatar for Gribouillis
0
89
Member Avatar for fatjoe22

My assignment for python is to create a card game where 2-3 draw 3 random cards in order to try to get a total of 31. If there are three identical cards(ex player has 3 2's). That value is equal to 30. At any point does a player get 31, …

Member Avatar for woooee
0
636
Member Avatar for Hoff123

Hi! I am just wondering what would be fastest(performance-wise) of Game Maker(with GML) or Python with Pygame?

Member Avatar for Tumlee
0
288
Member Avatar for vegaseat

If a word or sentence reads the same way forward and backward, then it is a palindrome. A small admonition is in place, whitespaces and punctuation marks can be ignored. Also, all the letters should be in one case, lower or upper, your choice. Ideal for Python to show off …

Member Avatar for Gribouillis
0
1K
Member Avatar for ao_py

I am trying to draw circle in the upper left corner of a graphics window, and then move that circle at a diagonal to the bottom right corner, and then bounce it back to the upper left, and so on until my loop is exhausted. I can't get my moving …

Member Avatar for woooee
0
1K
Member Avatar for beck4456

I'm trying to write a program that takes a string and prints one letter per line. I need to use a while loop based on string length. I googled, so sorry for the newbie question. Thanks!

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for sonicx

I'm trying to find max and min values from a text file which contains data in rows and columns. But I want to create a script which will skip the first couple of lines and calculate the max and min from there on. I am aware for the max and …

Member Avatar for woooee
0
14K
Member Avatar for terry_bogart

Not sure how to do this I tried googling it but to no avail. I want to print out a specific line in my while loop [CODE]450 42.5 16625.0 460 42.0 16820.0 470 41.5 17005.0 480 41.0 17180.0 490 40.5 17345.0 500 40.0 17500.0 [/CODE] example of part of my …

Member Avatar for JoshuaBurleson
0
148
Member Avatar for effBlam

I am making a program that analyzes text from a user After inputting several line and using the keyword "DONE", the program will ask for one of 8 possible options which is the menu() function where the user will enter the number. How would i be able to run my …

Member Avatar for JoshuaBurleson
0
211
Member Avatar for effBlam

Im trying to find the first element in each nested list: x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] So that I get print a string: "hw ayo iaf" so far I have: def first_letters(): x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] Thanks!

Member Avatar for Gribouillis
0
91
Member Avatar for effBlam

Im trying to get the last element in each nested list such as double list = [['Hello','how','are','you'],['I','am','fine'],['How','about','yourself']] so that it will print out ['you','fine','yourself] I am also trying to do this all under a function such as def last_words(): #where my double_list is already in this function Thank you!

Member Avatar for Gribouillis
0
89
Member Avatar for nered

[CODE] maxHList = [(5,3),(7,4),(9,5)] totalH = 0 maxH = 0 x = 0 while x < len(maxHList): totalH = math.sqrt(pow(maxHList[x+1][0] - maxHList[x][0],2) + pow(maxHList[x+1][1] - maxHList[x][1],2)) maxH += totalH x += 1 [/CODE] I am going +1 over the list length and i get this error but if i say …

Member Avatar for Gribouillis
0
93
Member Avatar for geekman89

Please, please explain to me why this is giving me an error: [CODE]class bvo: C = 'Hello' def getC(self): return self.C bvo.getC()[/CODE]

Member Avatar for geekman89
0
145
Member Avatar for KenGreen

In an earlier post, Tech-B stated that, other then dialogs, there wasn't 'any "real" GUI support' in Python that uses the Android SDK or SL4A/SAE. Has anyone tried Jython with the Android SDK?

Member Avatar for Tech B
0
372
Member Avatar for sofia85

Hi, I don't understand how to write unix shell commands in python. I have this txt file were I want to delete duplicates. It looks something like this: RTGR.txt FRTO.txt RTGR.txt SDOP.txt QWJL.txt SDOP.txt FRTO.txt FRTO.txt ...etcetc... I think I'm suppose to import os and then I want to use …

Member Avatar for sofia85
0
139
Member Avatar for Tcll

ok for one... I must say I'm a noob at classes, but have made some pretty good apps using nothing but functions. I'd like to get into classes though, and every time I try, I end up misunderstanding 1 or 2 things and messing the whole thing up... <:\ can …

Member Avatar for Tcll
0
161
Member Avatar for giancan

Hi guys, I have a difficult problem to solve. I have a list with 4 columns of values as follow 750.633 379.039 652.524 1112.63 930.491 452.16 842.753 1191.78 882.063 446.411 787.56 1183.43 434.362 410.174 325.863 1145.34 954.426 445.297 865.449 1183.74 1233.67 194.909 1155.27 908.305 1505.97 917.95 1441.07 1698.01 852.882 133.219 …

Member Avatar for Gribouillis
0
289
Member Avatar for Cupidvogel

Hi, I find in all books and websites that in order to run a Python script from the command prompt, I have to run something like this [CODE]python example.py 1.3[/CODE] where [B]example.py[/B] script is provided with an argument of 1.3. However, it is not working for me in Windows 7 …

Member Avatar for TrustyTony
0
298
Member Avatar for MegaMan15

Hello all. So I am trying to write a program that will read in a text file, then it will scan the file for prompts, such as %[color], %[noise], etc. Then from what prompts are within that file, the program will ask the user what word they would like to …

Member Avatar for Gribouillis
0
112
Member Avatar for Wilha

My goal is to output monthly cost insrance for entered employee id, but my program keeps giving me a error idk why [CODE]import sys #empfile=raw_input("Enter Emp.file Name:") #emp=sys.argv[1] #print emp #usage : run it as follows from command line. #python db.py employee.txt InsurancePlans.txt InsurancePolicies.txt def dict2(lines): dict={} for l in …

0
84

The End.