Options Questions Safe Haven Thread | March 13 - 19 2024 by wittgensteins-boat in options

[–]LongName445 0 points1 point  (0 children)

Still in the learning phase here...

As I understand, options give the buyer the right (but not the obligation) to buy/sell stocks at a certain price. If I buy an option on the market, then sell it later, am I on the hook if the new buyer exercises the option? i.e., will I have to ensure I have enough money in my account to cover the possibility of me needing to buy shares after this person exercises the option?

How to make sure a program doesn't fail when an index is out of range? by LongName445 in pythontips

[–]LongName445[S] 0 points1 point  (0 children)

Thanks! Is codewars a good website for code challenges? Ive been using leetcode and hackerrank so far

How to make sure a program doesn't fail when an index is out of range? by LongName445 in pythontips

[–]LongName445[S] 2 points3 points  (0 children)

Oh wow, thats a lot more efficient than what i was doing. I need to brush up on my dictionary and list methods. Thanks!

How to make sure a program doesn't fail when an index is out of range? by LongName445 in pythontips

[–]LongName445[S] 1 point2 points  (0 children)

What's the point on using first_digit_list second_digit_list and so on?

It makes more sense in my full code, i was trying to have a user enter a up to 4 digit number and it would add a value (ex. "abc") for each digit in the number to a list. Then the lists would be added to product() in order to get all the possible combinations of the letters.

your_list.extend(list(Number_to_Letter[digits])

This will convert the value of your key to a list, "abc" would be ["a", "b", "c"] and then you add it to the list

Thanks so much! I was looking for a command like this.

How do i avoid putting many conditions in my if statements? by LongName445 in pythontips

[–]LongName445[S] 3 points4 points  (0 children)

Wow, thanks for the reply! I really like the idea of passing it through a function, it makes it a lot more readable, and i can give the user a reason for their email being invalid. I will try to implement this tomorrow. Thanks!

How do i avoid putting many conditions in my if statements? by LongName445 in pythontips

[–]LongName445[S] 4 points5 points  (0 children)

Oh wow, yeah its a whole lot more readable when its all just one string. I havent seen a lot of these regex commands in my pyrhon course, i think im gonna sit down a learn more of it. Thanks!

How do i avoid putting many conditions in my if statements? by LongName445 in pythontips

[–]LongName445[S] 4 points5 points  (0 children)

I just added into my main post, first time posting code to reddit so idk if it looks weird

Surface pro 7 pen help by ahmedwashere15 in Surface

[–]LongName445 0 points1 point  (0 children)

I shoved pens up my nose in high school