Hi, Everyone:
What is the source of the following,
'error message: SyntaxError: invalid syntax (, line 2)'
v. Python 3.3
Code reads:
x=1
if x==1
# indent 4 spaces
print "x = 1"
Hal
--
https://mail.python.org/mailman/listinfo/python-list
Hi Everyone,
What is the list equivalent to line 12: ncount.sort(reverse=True)
count = dict()
fname = raw_input("Enter file name: ")#
handle = open (fname, 'r')#
for line in handle:
if line.startswith("From "):
address = line.split()[5]
line = line.rstrip()
count[a
M, MRAB wrote:
> On 2015-08-12 01:01, Ltc Hotspot wrote:
>
>> Hi Everyone,
>>
>>
>> What is the list equivalent to line 12: ncount.sort(reverse=True)
>>
>>
>> count = dict()
>> fname = raw_input("Enter file name: ")#
>>
Chris,
Check the code and the visualize execution of the code, available at
http://tinyurl.com/p8tgd5h
message reads: NameError: name 'collections' is not defined
Regards,
Hal
On Tue, Aug 11, 2015 at 5:49 PM, Chris Angelico wrote:
> On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hot
Message heard loud and clear:
There are no error messages, the output is the issue.
Question: What sorted function should I write to produce the desired
output, below:
Desired output:
04 3
06 1
07 1
09 2
10 3
11 6
14 1
15 2
16 4
17 2
18 1
19 1
Latest revised code:
count = dict()
fname = raw_i
Denis,
Using the attached file of a diagram as a frame, why is there an
attribute message?
-
Here is the attribute message:
AttributeError
Traceback (most recent call last)
C:\Users\vm\Desk
;list' has no attribute 'split'
In [46]:
Regards,
Hal
On Wed, Aug 12, 2015 at 9:45 AM, MRAB wrote:
> On 2015-08-12 17:29, Ltc Hotspot wrote:
>>
>> Denis,
>>
>>
>> Usin
Emile
How do I define time in the revised code ?
---
Traceback Message reads:
In [66]: %run assignment_10_2_v_07
NameError
Traceback (most recent call last)
C:\Users\vm\Desktop\apps\docs\Pyt
")[5] # Sort hours
line = line.rstrip()
count[hours] = count.get(hours, 0) + 1 # counter
lst = [(val,key) for key,val in count.items()]
print key, val
On Wed, Aug 12, 2015 at 11:59 AM, MRAB wrote:
> On 2015-08-12 19:35, Ltc Hotspot wrote:
>>
>>
f.close()
NameError: name 'X' is not defined
In [74]: print X
---
Print X:
NameError
Traceback (most recent call last)
in ()
> 1 print X
NameError: name 'X' is not defined
In [75]:
On Wed, Aug 12, 2015 at 2:25 PM, Gene Heske
On Wed, Aug 12, 2015 at 3:35 PM, MRAB wrote:
> On 2015-08-12 22:16, Denis McMahon wrote:
> [snip]
>
>> c = [0 for i in range(24)]
>> f = open(filename,'r')
>> for l in f:
>> h = int(l.strip().split()[X].split(':')[Y])
>> c[h] = c[h] + 1
>> f.close()
>> for i in range(24):
>> print '
>> How do I define the file name in order to remove the traceback?
>>
> At this point I think I'll just let you figure that out for yourself...
>
> --
> https://mail.python.org/mailman/listinfo/python-list
MRAB,
How do I define X?
--
So calling people stupid and ignorant on the internet makes you sexual
arousal and to masturbate with yourself
On Wed, Aug 12, 2015 at 1:38 PM, Denis McMahon wrote:
> On Wed, 12 Aug 2015 12:05:37 -0700, Ltc Hotspot wrote:
>
>>>Have a look at assignment_10_2_v_06.py.
>
>&g
On Thu, Aug 13, 2015 at 2:15 AM, Denis McMahon wrote:
> On Wed, 12 Aug 2015 16:46:32 -0700, Ltc Hotspot wrote:
>
>> How do I define X?
>>
> -
>> Traceback reads:
>>
>>
14 matches
Mail list logo