( senator, usSenators ):
print( usSenators[senator] )
def main():
usSenators = createList( "USSenators.txt" )
usSenators2 = createList2( "USSenators.txt" )
test( "Texas", usSenators )
test2("Udall", usSenators2 )
main()
On Tue, Dec 3,
. I know I need to loop through the list of names, which I have, and
set a condition dor the apppearance of a string occurring more than once in
a list but I don't know how to translate this to code. How do I say: if
you see it twice, do something?
On 2 December 2013 02:25, Byron Ruffin
The following program works and does what I want except for one last
problem I need to handle. The program reads a txt file of senators and
their associated states and when I input the last name it gives me their
state. The problem is "Udall". There are two of them. The txt file is
read by lin
Need a little help with finding a process for this:
when a string of text is input, for example: abc def.
I want to have each letter shift to the right one place in the alphabet.
Thus..
abc def would be output as bcd efg.
Any ideas on how to do this?
__
def main():
goal, apr, deposit = getSavingsDetails()
determineMonthsTilSaved( goal, apr, deposit )
months = determineMonthsTilSaved(goal, apr, deposit)
summarize( months )
def getSavingsDetails():
"""
goal = float( input( "Principal sought? $" ) )
apr = float( input(
def main(x, y, z):
print (x, y, z)
def funct():
x = 1
y = 2
z = 3
return x, y, z
main()
Can someone tell me why main is not being given any arguments?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
The output generates a sentence made up of words chosen randomly from
lists. I am having trouble getting a space between each of the words.
Should I be thinking about .split? Here is the code (ignore indent errors
as it was copied and pasted) Thank you:
import random
def wordList():
adj1 =
I am writing a simple program based off an ipo chart that I did correctly.
I need to use ceil but I keep getting an error saying ceil is not defined.
I did import math, I think. I am using 3.2.3 and I imported this way...
>>> import math
>>> math.pi
3.141592653589793
>>> math.ceil(math.pi)
4
>>>