#This is able to tell the user what the type of an object is
string_example = "string"
int_example = 1
float_example = 1.1
type_of_string = type(string_example)
#<class 'str'>
type_of_int = type(int_example)
#<class 'int'>
type_of_float = type(float_example)
#<class 'float'>
#1) To type a string using the keyboard module:
#pip install keyboard
import keyboard
string = "This is what I typed"
keyboard.write(string)
#2) To check if an object is of the type 'str' (to check if the object is a string):
if type(object) == str:
#3) To print a string:
string = "This is displayed in your Big Black Console"
print(string)
>>> print(type(7), type(7.5), type('hello'), type(int))
<class 'int'> <class 'float'> <class 'str'> <class 'type'>
x = "You Rock!" #str
x = 69 #int
x = 69.9 #float
x = 1j #complex
x = ["red", "blue", "green"] #list
x = ("red", "blue", "green") #tuple
x = range(20) #range
x = {"name" : "Taylor", "age" : 35} #dict
x = {"red", "blue", "green"} #set
x = frozenset({"red", "blue", "chegreenrry"}) #frozenset
x = True #bool
x = b"You Rock!" #bytes
x = bytearray(10) #bytearray
x = memoryview(bytes(10)) #memoryview
x = None #NoneType
b = ["Geeks", "for", "Geeks"]
print(type(b))