Classes
Functions
Objects only
Namespaces
What does the following code do?
from datetime import datetime dt = datetime.strptime("2024-11-22", "%Y-%m-%d") print(dt)
Returns the current date
Converts the string "2024-11-22" to a datetime object
Returns the string "2024-11-22"
Raises a ValueError
import math
from math import pi
include math
using math
import math as m
from math import sqrt
load math
from math import * print(cos(0))
Prints 1.0
Raises a NameError
Prints cos(0)
Error
Global
Enclosing
Built-in
Local