Python | Session - 12 | Ashok IT

preview_player
Показать описание
#python #programming #ashokit

💡 Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Website

💡 About Ashok IT :

Ashok IT is the No.1 quality training institute in India for the candidates who want to build their future in Information Technology. We are into online training, class room training, corporate training and one to one training with more passion and dedication. Ashok IT aims in providing best quality realtime oriented trainings on C, C++, Java, Spring , Spring REST, Spring Cloud, Microservices, Python, DJango, .Net, Angular, React JS, Salesforce, , Testing, Android, Docker, Kubernates, Manual Testing, Selenium and Digital Marketing.

-----------------------------------------------------------------------------------

💡 Our Online Training Features

🎈 Training with Real-time Working Professionals
🎈 Industry Matching use cases
🎈 Live Coding
🎈 Real-time Environment
🎈 Class Notes
🎈 Doubts Clarifications in Each Session

-----------------------------------------------------------------------------------

💡 Contact details:



#python #pythonforbeginners #pythontutorial #pythonprogramming
#pythonbasics #pythoncoding #pythononline #pythontraining
Рекомендации по теме
Комментарии
Автор

#the code for the date change which you have taken the example give blunder mistake while run time it dont show the error but logic is wrong .i have solved to it took me 2 hours.
as per your code if we enter the date beyond 31 will give 32 and above it taking and adding the day, and feb 29, 30, 31also it taking, and leep year taking the day 30, 31.
the folowing is solved code. sir
day, month, year = [int(x) for x in input(' enter the date:dd/mm/yyyy: ').split('/')]
if ((month == 12) and (day<=31)):
if day == 31:
day = 1
month = 1
year = year+1

else:
day = day+1
print (' the next date is {}/{}/{}'.format(day, month, year))
elif month in [1, 3, 5, 7, 8, 10]:
if day == 31:
day = 1
month = month + 1
else:
day = day+1
print('the next date is {}/{}/{}'.format(day, month, year))
elif month in [4, 6, 9, 11] and day<31:

if day == 30:
day = 1
month = month + 1
else:
day = day+1
print('the date is {}/{}/{}'.format(day, month, year))
elif month in [4, 6, 9, 11] and day >=31:
print('hyy fool the enterd date is not comes in the month check the date')

elif month == 2:

if( (year%4==0) and not (year%100==0) and (day<=29) or (year%100==0) and (day<=29) ):
if (day == 29) :
day = 1
month = month+1
# print('the date is {}/{}/{}'.format(day, month, year))
else:
day = day+1
print('the date is {}/{}/{}'.format(day, month, year))
else:
if (day == 28):
day = 1
month=month+1
print('the date is {}/{}/{}'.format(day, month, year))

else:
if ((day==29) or (day==30) or (day==31)):
print('are you mad 2 month has no day that you have entered')
else:
day = day+1
print('the date is {}/{}/{}'.format(day, month, year))

else:
print ('check the date that you have enterd')

siddiqsowdhagar