15,901,426 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13949923 (Top 7 by date)
Member 13949923
19-Jul-19 10:45am
View
thank you so much for all the help, solved it now.
Member 13949923
19-Jul-19 9:14am
View
Deleted
hey again Richard. I have changed my code. Got rid of True or False but I still only get my first if statement. Al the other statements are ignored. Is there something wrong with my syntax?
for key, value in hourly_dates.items():
if key in first_indices:
if value == morning_hours:
today_date.append('09:00:00')
else:
if value == noon_hours:
today_date.append('11:00:00')
else:
if value == evening_hours:
today_date.append('19:00:00')
else:
if value == night_hours:
today_date.append('21:00:00')
return today_date
p.s the indentations are like the original code above not like in this comment
Member 13949923
19-Jul-19 7:34am
View
hourly_dates = {'morning': morning_hours, 'noon': noon_hours, 'afternoon': afternoon_hours, 'evening': evening_hours, 'night': night_hours}
If the there is an input such a 'Today evening' and the datetime is in the 'evening' parameter(between 18:00:00 - 21:00:00) it returns 'True' and then prints [current date '19:00:00'] but if input is 'Today morning' it should get 'False' for the first if statement 'Value == True' and then move to second if statement (Value == 'morning_hours') after else statement and so on. But when I input 'Today noon' it does not move to next if statement that has the 'Value == noon_hours'. It just keep printing if statement of 'morning_hours' and don't move the next statement.
Member 13949923
18-Jul-19 6:48am
View
I think u might be on to something here but I don't fully get it. Would be kind and reformulate what u mean?
Member 13949923
18-Jul-19 6:46am
View
I have tried debugging myself and with Visual Studio with no veil. Because my code returns an answers [current date '09:00:00'] although I ask for [current date '11:00:00'], the debug shows no problem. I think my problem is with the logic syntax of Python. It should go to next if statement after "value == morning_hours" shows False. But it doesn't.
Member 13949923
15-Aug-18 7:36am
View
Thank you for the great answer. I think I get it now. Correct me if I am wrong. Basically, the multiplication process is taking through the parameter 'a' being added to the result of the 'mult(a, b-1)' by an recursive action since 'mult(a, b-1)' is a smaller function inside of its own greater mirror function def 'mult(a, b)'.
Member 13949923
15-Aug-18 7:00am
View
"I've tried putting bunch of prints but it still doesn't show me how it does multiplication without a multiplication operator." Edit: I just got it why.
Show More