- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
I'm just trying to create a program that will remove all the trailing whitespace in a text file. (Like all the whitespace after each sentence for the whole text file.) [CODE] n = raw_input("Enter name of file: ") f = file(n, "r") fr = f.read() for fr in f: fr … |
|
for example if i wanted to add a list to another list, like: a = [a,b,c] b = [1,2,3] my code: [code] def add(a, b): a = a.append(b) [/code] it would output ['a', 'b', 'c', [1, 2, 3]] what do i have to change to make it output ['a', 'b', … |
|
I'm just wondering what do I have to add to the code [code] print "Hello World" [/code] to output H e l l o W o r l d like there's spaces in between each letter? Thanks. |
|
Hi I'm trying to write some functions. This first function is suppose to help shuffle two strings which are the same length into the correct word. So the output would be something like: After shuffling the first string som and the second string trs the word is storms. Here is … |
|
hi, im trying to make a program that simulates the game Risk. It should output something like this: [code] Attacking Army: Army A Defending Army: Army B Number of attacking army: 4 Number of defending army: 3 ----------------------------------- Round 1: Army A: 3, Army B: 2 Attackers' Dice: 5 2 … |
|
Hi, I want to make a program that can make asterisks around the text, so the output is something like this: Enter string: Hello World ************* * Hello World * ************* I do not want to use the multiplication technique (ex: "*" * 5), and I want to try using … |
|
I want to use a while loop to count up numbers. The output would be something like this: Start: 1 End: 10 Count by: 3 1 4 7 10 Here's my code right now: [CODE] start = int(raw_input("Start at: ")) end = int(raw_input("End at: ")) count = int(raw_input("Count by: ")) … |
|
I want to make a program that outputs something like: Enter integer: 117 117 is lucky! Enter integer: 1003 1003 is not lucky! So, if the integer entered contains at least one 7 in it, it will output is lucky! And if it doesn't it will output the is not … |
|
Here's my code: [CODE]metres = float(raw_input("Enter the height (in metres): ")) total_inches = 39.37 * metres feet = int(total_inches/12) inches = int(round(total_inches - feet*12)) if inches < 0.5: print "Sorry, you have entered a height that is less than 1/2 inches," \ " please re-enter a new height." elif feet … |
|
Hi, the program is this: Discount problem: Available deals: 10% off the total price when you buy $200 or more 15% off the total price when you buy $500 or more 20% off the total price when you buy $1000 or more Write a program that outputs the value, price … |