Python Decision Making Functions

Python Decision Making Functions | Part 2 20 min

  

If--elif-else condition working with example, while loop with working and example, for loop and its example, Usage of keyword : Continue, Break, Pass, from , import, date and time in python with example, making and calling of functions in python, local and global variable

QA Section

Speak Your Mind


Ahmed Faraz

I'm getting this error: 2021-05-05 16:17:57.735665 05-May-2021 2021-05-05 16:17:57.770827 05-May-2021 Traceback (most recent call last): File "C:\Users\18326\PycharmProjects\MyFirstProject\datetime.py", line 12, in string_formattedDate = datetime.strptime(date, "%d/%m/%Y") File "C:\python39\Lib\_strptime.py", line 15, in import calendar File "C:\python39\Lib\calendar.py", line 9, in import datetime File "C:\Users\18326\PycharmProjects\MyFirstProject\datetime.py", line 12, in string_formattedDate = datetime.strptime(date, "%d/%m/%Y") AttributeError: partially initialized module '_strptime' has no attribute '_strptime_datetime' (most likely due to a circular import)

Reply

Chiranjiivi

Hi Jaspreet, I tried the below code as per your explanation but I`m getting an error. Can I request you to kindly have a look please? from _datetime import datetime dt = '04/06/2021' fd = datetime.strptime(dt, '%Y,%d %m') print(fd) Result: AttributeError: partially initialized module '_strptime' has no attribute '_strptime_datetime' (most likely due to a circular import)

Reply

DEEPAK KUMAR TIWARI

Nice explanation , clear sound , appropriate explanation speed.

Reply