11 Topics

Member Avatar for
Member Avatar for Niloofar24

Hello. mylist = [6, '/', 3, '+', 9, '+', 8, '+', 1, '/', 2] How can i delete that list indexes? I tried: def clear(self, event): global numbers for i in numbers: print i del numbers[i] But it didn't work: File "./kivycal", line 83, in clear del numbers[i] TypeError: list …

Member Avatar for Niloofar24
0
274
Member Avatar for Tycellent

Hey guys, Was wondering if someone could assist me in elaborating the c_str() function... I understand that it returns a pointer to an array that contains a null-terminated sequence of character but could someone further elaborate upon this, perhaps with a simple example. Cheers,

Member Avatar for Lerner
0
176
Member Avatar for nouth

my [previous question](http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/477450/convert-str-to-var) about this dealt with global vars but unfortunatley the `window` of opportunitys doesn't work with this next example because it alerts 4 times instead of only 1 test("a","b","c"); function test(var0,var1,var2,var3) { for(var i=0; i<4; i++) { if(window["var"+i]===undefined) {alert("test");} } } this may not be very clear so …

Member Avatar for felgall
0
345
Member Avatar for nouth

this is my attempt var test=["a","b","c"]; var var0="a"; for(var i=0; i<1; i++) { test.splice(test.indexOf(test[window["var"+i.toString()]]),1); } alert(test); it alerts "a,b" but I want it to alert "b,c" ref:http://stackoverflow.com/questions/5613834/convert-string-to-variable-name-in-javascript

Member Avatar for nouth
0
421
Member Avatar for RHNation

def main(): print ('Welcome to the mpg calculator program') print() #get the miles driven using the input function miles_driven = input ("Please enter miles driven: ") miles_driven = float (miles_driven) #get the gallons used using the input function gallons_used = input ("Please enter gallons used: ") galons_used = float (gallons_used) …

Member Avatar for farmwife
0
297
Member Avatar for hwoarang69

how to copy pointer to pointer. char *name1; //store the value of DAVE char *name2; if name2 was a array i would have done. strcpy(name2,name1); but i dont know how to copy pointer into pointer. i was thinking some thing like this. name2 = name1? also do i need to …

Member Avatar for Shardendu
0
162
Member Avatar for hwoarang69

*i am trying to copy the value of ar2[10] //in main. has the value 1,2,3,4,5 in ar[10] //(in struct node). empty array so to copy the value iam not sure if i could use a strcpy for ex, strcpy(head->ar, ar2); //here is my code struct node { int ar[10]; //empty …

Member Avatar for hwoarang69
0
146
Member Avatar for Malraux

Hello I have a sequence that looks like this: 60211401dc070000 which is a string (it was build through a series of concatenations and conversions) How can i just tell him that it is actually a hex ?? without modifying it's value... Thanks! Have a nice day

Member Avatar for Lucy Four
0
309
Member Avatar for Shady Baddarni

how can i compare 2 string for bull hit game in python. i wrote the program itself. how can i find how many hits and bulls i have. [CODE]import string import random import re m = input (' Please input the long of the string you want to guess :') …

0
89
Member Avatar for simulacrx

Hi all ; [ICODE]ask=raw_input("type the query: ") [/ICODE] when i type [ICODE]23+9[/ICODE] after this; i wanna get '32' result.. like ; [ICODE]>>>type the query: 3+5 >>>result : 8[/ICODE] this is what i want.. thank you..

Member Avatar for Gribouillis
0
246
Member Avatar for danholding

input [CODE=python]import math print(repr(math.pi)) print(str(math.pi)) [/CODE] output [CODE=python]3.141592653589793 3.141592653589793[/CODE] could someone please tell me what the difference between [CODE=python]repr[/CODE] and [CODE=python]str[/CODE] is as the example on the documentation does not help as they both return the same figure? surely it does something more complex?

Member Avatar for vegaseat
0
1K

The End.