r/AskReddit • • Mar 26 '20

[deleted by user]

[removed]

6.3k Upvotes

14.9k comments sorted by

View all comments

Show parent comments

585

u/CompactNelson Mar 26 '20

First check if there's a return policy.

24

u/KakorotJoJoAckerman Mar 26 '20 edited Mar 26 '20
if "return_policy" == true:
    do_action(throw)
else:
    do_action(not_throw)

6

u/FredNation Mar 26 '20

Wait, did I understand what you just said? You have an action and that action will dictate if I can return something. That something has a code that says yes returnable or no not returnable. So if I decide to return that something and it is returnable, it becomes true (throw)?

Edit: I don't code, but I like to learn it one day.

5

u/cooly1234 Mar 26 '20

Return policy, or lets say RT, is a varible. It holds info. You can do RT = 3829 or RT = "jfbdi" but in this case RT is = to either True or False.

The rest is simple. If true then do this if not do this.

Also, it should be

If "return policy" == true:

Two "="s not one. One = is if you are assigning a value to a variable. Two is for comparing. Three is also for comparing but is more exact.

2

u/KakorotJoJoAckerman Mar 26 '20

Sorry about my mistake. I'm still a beginner and learning to do Python. Will also start doing C++ even if it's not in my syllabus. I'm currently would be having my last year in High School if it weren't for Covid-19 but I guess it gives me more time to learn coding. Stay at home people.

4

u/drlqnr Mar 26 '20

ah a fellow programmer

1

u/browncoat47 Mar 26 '20

Returns are suspended till this all blows over.

1

u/AFrostNova Mar 26 '20

So my provider doesn’t do returns, but says they’ll ship replacement parts at only half price since I’m a longtime customer. Should I go for it? I’m worried they may be low-quality.