My first REPL
Yasss bruhs, my first Repl!!! Some of you may know me on Scratch.mit.edu as HyperGamerStudios but now I am on repl because of my computer science class :D
(UPVOTE THIS FOR A COOKIE, also go follow me on Scratch for THREE cookies.(Note: MAY OR MAY NOT BE BROWSER COOKIES, lol))
@HyperGamerStuds please do not ask for upvotes, as upvoting is only a way of liking something, which if people do not like it, they will not upvote, repl.it is not for upvotes but for coding and sharing programs (and plenty more) but its not about upvotes. So do not beg for upvotes in the future, or say something thats not going to happen(Like getting a cookie) so, please, please, PLEASE do not just post for upvotes post to share your code
Edit: also this is not scratch, so yeah
Edit-EDIT: also i just wanted to tell you before you started doing more coding on repl.it, that it is not for upvotes, and I know it is addictive to post something and get upvotes but sometimes that can lead you down the wrong paths.
EDIT EDIT EDIT: Also I am not telling u what to do, you can do whatever you want, Just dont put OR DIE as a threat. Because you CAN get banned for that
Suggestion, you want this program to be valid at all times?(Not just 2020) Change 2020 to
datetime.datetime.year(I think) This will put the current year in place of 2020, which for now is 2020, but next year obviously it will be 2021. Also you have to
May I have your scratch info?(just your profile link) I’m also a scratcher. I’m asking this so I can see some of your work. :)
@VMTU :D, I don't usually use repl for recreational use but if u want u can talk to me about such concepts either on here or on Scratch! (especially check out my newest game hordes.io, it is highly advanced :))
@HyperGamerStuds I can help you with any python projects you need. I am pretty fluent in the language so ill be glad to help ^-^ https://repl.it/teams/join/yldpasaoeixeoadyxdtoeuixjkiwyufh-DreamVTechno heres my team link too if you would like to join
Hey, we've unlisted this for now because it looks fairly low-effort. If you edit the description to add more info and/or add more to the code, reply to this comment and I’m happy to relist it!
Since this post is locked, you won't be able to reply to my comment. Feel free to email me at [email protected] instead.
This is what I'd recommend:
userInput = none def testInput(input) -> bool: try: int(input) except: return False else: if int(input) < 0 or >= datetime.datetime.today().year: return False else: return True firstTime = True while not(testInput(userInput): if firstTime = False: print("Invalid Year") userInput = input("What year were you born: ")
It asks you to input the year again is it cannot be converted to a string or the value is negative
I can give you some advice so that you don't have to be changing the minus date- 2020 - every year that passes