How to read this piece of code step by step? [closed] - python

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 1 year ago.
Improve this question
def func(num):
if num==1:
return 1
num=num-1
print(num)
z=func(num)*num
print(num)
return z
func(6)
I am a beginner in python study and it's hard for me to read recursive code like this.
Could you guys introduce the right step of reading this piece of code for me?
I am also a little puzzled that why the two sets of output are in contrary order.
Thanks.

Try using this site to visualize your python code in a step-by-step manner:
Python visualisation tool
This site helped me as a beginner to understand and debug my code.

Related

New into programming [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
How do I start a code in Python? Is there any formula/rule or so I can or have to use/follow?
I have read so much about all different types and functions in python, and still am not able to simply start with a code, although I know in my mind, what is to be considered.
I tried to start, there where error messages I didn't understand, then I went to ChatGPT and all my ideas were most of the time correct, but I can't create the right form of the code.
And somehow I am not able to get it out of all the stuff I already read.

Telling if stories are fake or real using 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 4 days ago.
Improve this question
I am looking forward to building a program in python which tells if a text is fake or real. This is a project I want to start for educational purposes. For example, someone is sharing a story, the program will check the input and will determine whether the author is likely telling truth or fiction based on common patterns. I am looking for some things I can start off from, like libaries or documentation. Thanks for anyone who is willimg to help.

How to find the widest and narrowest part of an object? [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 10 months ago.
Improve this question
I am new to the world of image processing. And I am working on a project, where I need to find the narrowest and widest part of a letter/object like the one I have attached to the post. I have tried many things, but I do not get proper results. Can you help with a way to approach this. I am mostly using Python and OpenCV.
Thanks in advance!

how can I observe a change in a python var [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 1 year ago.
Improve this question
Hi I'm trying to catch the change in the paperclip of my computer with the library pyperclip something same as
url=pyperclip.paste()
I want to create a thread which can append all the urls into a list my script, but I don't know how to could I do it
Thanks for your time and help c:
Did you check the documentation or the source code at all? That's all I did. pyperclip supports waitForPaste and waitForNewPaste methods that can do this.

How to make different message windows 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 8 years ago.
Improve this question
I am beginner of Python, does anyone knows how to make a different shapes of message windows in python? i want to design a better look and friendly GUI.
Thank you
I think Qt is what may be useful to you. Take a look at the documentation on QtProject homepage. Lots of tutorials can be found on the Internet. For your specific problem take a look at this SO question.

Categories