How can we pass a variable value in python GOTO statement

0 votes
Alias is a runtime argument the value may be anything at the run time like dev, prod, pre-prod.

I need to pass that Alias value into goto like as follows.

Alias = Input()

goto Alias

label: dev
do something

label: prod
do something

label: pre-prod
do something

Can anyone clarify this? Thanks in advance
Feb 5, 2020 in Python by neppoliean
• 120 points
240 views
Hi, @Neppollean,

There are three possible ways to arrive at the "end". According to the condition it is going to either dev or prod or pre-prod.

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

How can I change the iteration variable inside a for loop in python?

Assume you have a list of lists: my_list ...READ MORE

answered Jun 10, 2019 in Python by Shubham Bansal
3,017 views
0 votes
0 answers

How can we read a text file in a list in python?

Can you give the sample code as ...READ MORE

Jun 18, 2019 in Python by Waseem
• 4,540 points
104 views
0 votes
1 answer

How can I make a variable private in python?

Python does not have any private variables like C++ or ...READ MORE

answered Aug 2, 2019 in Python by Mohammad
• 3,230 points
141 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,890 points
14,364 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
438 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,174 views
0 votes
0 answers