Question
Question 11 pts The is digit() method of a string returns the digits that are in the string the string if it only contains digits
Question 11 pts
The is digit() method of a string returns
the digits that are in the string |
the string if it only contains digits |
true if the string contains only digits |
true if the string contains only digits and a decimal point |
Flag this Question
Question 21 pts
To access the first three characters in a string thats stored in a variable named message, you can use this code:
first_three = message[0:2] |
first_three = message[1:3] |
first_three = message.slice(0:2) |
first_three = message.split(0:2) |
Flag this Question
Question 31 pts
To determine the length of a string thats in a variable named city, you can use this code:
len(city) |
city.len() |
length(city) |
city.length() |
Flag this Question
Question 41 pts
To retrieve the fourth character in a string thats stored in a variable named city, you can use this code:
city(3) |
city[3] |
city(4) |
city[4] |
Flag this Question
Question 51 pts
Which of the following will display this result? B = 66
print("B = ", char("B")) |
print("B = ", ord("B")) |
print("B = ", ascii("B")) |
print(ord(66)) |
Flag this Question
Question 61 pts
To create a datetime object for the current date and time, you can use the
now() method of the date class |
today() method of the datetime class |
today() method of the date class |
now() method of the datetime class |
Flag this Question
Question 71 pts
To create a datetime object by parsing a string, you can use the
strptime() method of the date class |
parse() method of the datetime class |
strParse() method of the datetime class |
strptime() method of the datetime class |
Flag this Question
Question 81 pts
To format a datetime object for the current date and time, you can use the
strftime() method of the datetime class |
format() method of the datetime class |
strftime() method of the datetime object |
format() method of the datetime object |
Flag this Question
Question 91 pts
To store just the year, month, and day for a date, you use a
datetime object |
date object |
either a date or a datetime object |
datedelta object |
Flag this Question
Question 101 pts
To work with dates, you need to import
the date, time, and datetime classes from the datetime module |
the date class from the datetime module |
the date class from the date module |
the date and datetime classes from the datetime module |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started