How Can We Help?
Introduction:
In this tutorial, we are going to explain how to use Python string type function with basic syntax and many examples for better understanding.
Python string type() function is used to get the type of string by passing string variable in type() function.
Syntax:
type(string)
Input Parameters:
- string: where string is a string variable whose type needs to be found.
Example
num='1234' type of string print("Type of num: ",type(num))
Output
Type of num: (class ‘str’)
In the above Example, ‘type(num)’ is used to get the type of variable ‘num’.
In this tutorial, you have learned how to use type(string) function.
If you have an inquiry or doubt don’t hesitate to leave them in comment. we are waiting your feedback.But remember to understand the concept very well, you need to practice more.
Hopefully, it was clear and concise.
Similar Python Functions to String Type:
- min(string) : It returns a minimum value of string.
- max(string) : It returns a maximum value of string.
- len(string) : It returns type of string , if passed variable is string.
- str(seq) : It converts a sequence/string into string.
- del(string) : It deletes whole string or individual string element or all elements of string.
Related Articles
Python String – Mastering By Practical Examples (Comprehensive Guide)
Python Tutorials List:
- Python tutorials list : access all python tutorials.