Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (55.6k points)

A. int(x[, base])

B. long(x[, base])

C. float(x)

D. str(x)

1 Answer

0 votes
by (119k points)
edited by

The answer is option D (str(x)). str(x) converts the object to a string in python.

#Convert string to float

x = 1234

x1 = str(x)

type(x1) #check the datatype after conversion

Output:

str

You can check out this Python Functions to understand in-detail about data type conversions with examples.

Also, watch this video on Python Functions:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...