Skip to content
Advertisement

Tag: function

List and use the variables defined inside my own function

Suppose that I have a function like this one: Now can I use the a, bvariables? Even if foo() is not returning them like this? I know this is easy to do if foo was a class, but it’s not. Answer Even though you are saying you have a function, not a class, python is able to transcend those differences

Problem: Squares of a Sorted Array | Can anyone lookout this code [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question Can anyone recorrect this code? Code is not working properly. The output should

How can I write “EvenWord” Recursive in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question We tried to solve the following problem with friends but we couldn’t come to a conclusion. How can we approach

I get a IndexError: list index out of range Error

I´m having some troubles on my code, that implements a function that verifies the lenght of a string and return that string with or without spaces. If String b >= 15 return b If strinf < 15 return “number os spaces until len(b)2 + string b But I get a IndexError: list index out of range Error. I cannot figure

Advertisement