Built-In Functions

Function Description

format() Converts a value to a formatted representation

input() Reads input from the console

open() Opens a file and returns a file object

print() Prints to a text stream or the console


Python list()

The list() constructor returns a list in Python.

text = 'Python'

# convert string to list

text_list = list(text)

print(text_list)

# check type of text_list

print(type(text_list))

# Output: ['P', 'y', 't', 'h', 'o', 'n']

#         <class 'list'> 

No comments:

Post a Comment