Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Changing a variable's name on each iteration of a loop
Post: RE: Changing a variable's name on each iteration o...

(Jan-03-2020, 03:41 AM)Clunk_Head Wrote: (Jan-03-2020, 01:06 AM)rix Wrote: Is it possible in python to change the name of a variable on each iteration of a loop? For example: for i in range(10): ...
rix General Coding Help 6 84,741 Jan-03-2020, 03:52 AM
    Thread: Changing a variable's name on each iteration of a loop
Post: RE: Changing a variable's name on each iteration o...

(Jan-03-2020, 01:18 AM)jefsummers Wrote: You would be creating a debugging nightmare. But, if I was going to try such an abomination I would break out my copy of the Necronomicon and write code that...
rix General Coding Help 6 84,741 Jan-03-2020, 03:38 AM
    Thread: Changing a variable's name on each iteration of a loop
Post: Changing a variable's name on each iteration of a ...

Is it possible in python to change the name of a variable on each iteration of a loop? For example: for i in range(10): variableNameToChange+i="iterationNumber=="+str(i)I know this won't work, and...
rix General Coding Help 6 84,741 Jan-03-2020, 01:06 AM
    Thread: How to find something in a list using its index
Post: How to find something in a list using its index

Hello. How do you get an item in a list using its index? I am trying to remove a number of items from a list like this:for i in range(len(credentialsList)-3): credentialsList.remove(credentialsList.i...
rix General Coding Help 1 1,732 Dec-20-2019, 04:03 PM
    Thread: Problem defining a variable
Post: RE: Problem defining a variable

Ah. **idea** thank you all. I'll keep this thread unsolved until I have rectified the errors in my script so that if I have any more troubles I won't need to create a new thread / set this one 'unsol...
rix General Coding Help 6 3,195 Dec-17-2019, 11:34 AM
    Thread: Problem defining a variable
Post: RE: Problem defining a variable

Ah, so is it impossible to define variables with a def function that are recognisable outside of the method?
rix General Coding Help 6 3,195 Dec-16-2019, 06:27 PM
    Thread: Best Hotel in Jaisalmer
Post: RE: Best Hotel in Jaisalmer

Perhaps it sounds nice, but perhaps not appropriate to the forum or the website on which you're advertising it.
rix Bar 1 21 Dec-16-2019, 11:50 AM
    Thread: Problem defining a variable
Post: Problem defining a variable

def checkUserDesiredMethod(): userDesiredMethod=input("Would you like to register an account or login?\n(reg) /\n(login) /\n(none) /\n").lower() if userDesiredMethod=="reg": userWantsT...
rix General Coding Help 6 3,195 Dec-16-2019, 11:39 AM
    Thread: what would you call the input for the parameter(s) of a function you have defined?
Post: RE: what would you call the input for the paramete...

Thank you ichabod801. Perhaps I'll go with "argument" as it seems appropriate to me.
rix General Coding Help 3 2,452 Dec-16-2019, 12:04 AM
    Thread: what would you call the input for the parameter(s) of a function you have defined?
Post: what would you call the input for the parameter(s)...

What would you call what you would put into the parameters section when calling a function which you have defined? eg: def example(parameter): passIf I were to type in ' example(123) ' then what w...
rix General Coding Help 3 2,452 Dec-15-2019, 11:45 PM
    Thread: 'invalid syntax' error
Post: RE: 'invalid syntax' error

Thank you very much.
rix General Coding Help 3 2,373 Dec-12-2019, 11:13 PM
    Thread: 'invalid syntax' error
Post: 'invalid syntax' error

def accCredDatabasesMethod(method): if method=="open": accUsernameDatabase=open("accUsernameDatabase.txt","w+") accPasswordDatabase=open("accPasswordDatabase.txt","w+") if ...
rix General Coding Help 3 2,373 Dec-12-2019, 11:08 PM
    Thread: Basic subtraction error
Post: RE: Basic subtraction error

So there is no way to print precisely 1.30 or the correct answer in any case?
rix General Coding Help 4 3,416 Oct-10-2019, 08:51 PM
    Thread: Basic subtraction error
Post: Basic subtraction error

I'll show it with some code: Var1=str(input("What is Var1?") #For example user inputs 8.10 Var2=str(input("What is Var2?") #For example user inputs 6.80 Var1=float(Var1) Var2=float(Var2) Var3=Var1-Va...
rix General Coding Help 4 3,416 Oct-10-2019, 08:01 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020