Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Python
HI,
 
Here is the improved code.. In fact here i was trying to check string by mistake.. "second" is a string
 
i = random.uniform(-9.99999999999,9.99999999999)                
        j = random.randint(-499,499)                            
        k = random.uniform(-9.99999999999,9.99999999999)
        l = random.randint(-499,499)                            
        first = str(i) + 'EEX' + str(j)
        second = str(k) + 'EEX' + str(l)
        f.writelines(["[TEST COMPLEX_Real%0.0f]  conj(" % (n) + first + '+' + second + ")\n" ])
        second = atof(second)
        second = second * (-1)
        f.writelines(["[EXPECTED]" + first + "," + second + "\n [BINARY] 0\n[PRIORITY]\n" ])
 
i want to convert variable second to floating point number.
 
please help me to sort out this Issue.
 
Thanks in advance.
Posted 10-Mar-11 21:07pm
Edited 11-Mar-11 3:33am
v4
Comments
SAKryukov at 11-Mar-11 2:53am
   
Show more code, where "second" is assigned. Show exact indentation, which is important in Python or use full syntax.
--SA
Dalek Dave at 11-Mar-11 3:17am
   
Edited for Grammar and Readability.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 295
1 Maciej Los 280
2 Afzaal Ahmad Zeeshan 224
3 BillWoodruff 205
4 Sergey Alexandrovich Kryukov 195
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 11 Mar 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100