You know that Python is a dynamically typed programming language. That means you don't specify the type of variable while declaring it but it depends on the value it holds.
If you don't know what type of value a variable holds, pass it to the type() function.
2️⃣ dir()
Okay, you know how to check the type of variable. in the above code, the variable 'name' is of type 'str' stands for 'string'.
Now, you can pass this type of object into the dir() function to get all the availbe methods on that particular object.
Pretty useful, right?
3️⃣ help()
Awesome! You know all the methods on an object. But, you just have the names. Do you know, what arguments they take or how to use them?
Probably, you will Google for it. But, hey, wait a minute. We have help() function for that.
Syntax
→ help(object.method)
You have come to the end of this thread. Thank you for taking the time to read this. 💛
If you enjoyed this thread → 1. Consider retweeting the thread's first tweet. 2. Follow me on Twitter ( @junaidshaikh js) for more related content.
Prettier is the code formatter extension. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.