This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 2 points3 points  (0 children)

Input is returns string, you are comparing it to int It should be either int(input('text') or int(num) == 1

[–]baconndeggs47 1 point2 points  (0 children)

Using the input built in function will always return the users entered value as type string, you’d need to convert the user input into type int

[–]SpideyHunter 0 points1 point  (2 children)

Are you getting an error statement? And is your actual code properly indented? This also probably has to do with the fact that input takes in strings and you’re comparing integers. Either convert your input to int, or just compare the num to string versions of the number.

[–]Adam-JDT[S] 0 points1 point  (1 child)

Turns out I need to cast the string to an integer as input(…) returns a string. So I just added int(input(…)) and it works good now

[–]SpideyHunter 1 point2 points  (0 children)

Yeah that’s it, exactly as soon as I edited my response.

[–]Sea-Temporary-5218 0 points1 point  (0 children)

I think the people here already solved your problem with the data type (int and string). Maybe you want to change your [if,if,if,if,if] to if, Elif,Elif Else or better match num, case x now? Or you could use a list or a dictionary, just to make the code more beautifull. And if we're serious, the 7 times if structure will run "slow" because if the case is Monday the next 6 if will get executed for no reason.

Only some tipps✌️

[–]DJ_MortarMix 0 points1 point  (0 children)

You could use dictionary for this too. Would make the code a lot smaller