is this good?
age = 65
if age <18:
print("Minor LMAO😹")
elif 50<= age <60:
print("Ancient AAAH")
else:
print("Only ashes left💀")
is this good?
age = 65
if age <18:
print("Minor LMAO😹")
elif 50<= age <60:
print("Ancient AAAH")
else:
print("Only ashes left💀")
Good job
give this to dr disrespect it will be helpful
Ironically I did this while starting out in Python as well lmao
If you're 34 it'll print "Only ashes left💀", but the choice itself is fine
if ur age between 18 and 50 it gonna go to the else case
as said before, u need a case for between 18 and 50
The code will not work. Indentation error exists...
age = 65
match age:
case if age < 18:
print("Minor LMAO😹")
case if 50 <= age < 60:
print("Ancient AAAH")
case _:
print("Only ashes left💀")
here you go bud, cleaner code
SOURVLRT [#9]age = 65
match age:
case if age < 18:
print("Minor LMAO😹")
case if 50 <= age < 60:
print("Ancient AAAH")
case _:
print("Only ashes left💀")here you go bud, cleaner code
Naah for such small problem OP's solution is okay. No need for match-case if there aren't any complex conditions.
ALoKi007 [#10]Naah for such small problem OP's solution is okay. No need for match-case if there aren't any complex conditions.
match case looks cleaner though
SOURVLRT [#11]match case looks cleaner though
Yes that's correct. Though python is more about being optimal!
thank you everyone and yes my code does work
https://imgur.com/a/sFfGD1u
https://imgur.com/OO5wpSS
LingWang [#13]thank you everyone and yes my code does work
https://imgur.com/a/sFfGD1u
https://imgur.com/OO5wpSS
but 18 - 50, gives only ashes left :(
ALoKi007 [#12]Yes that's correct. Though python is more about being optimal!
im a java programmer, i dont know shit about python
how to fix because the code you paste didn't have the indents. me confuse bro
SOURVLRT [#15]im a java programmer, i dont know shit about python
I want to learn advanced JAVA 😭
SOURVLRT [#15]im a java programmer, i dont know shit about python
i thinks its a type of snake? (i dont know anything about code)
SOURVLRT [#14]but 18 - 50, gives only ashes left :(
works as intended
LingWang [#17]
50 isnt young
This is shit, quit now
widepeepofrosty [#22]This is shit, quit now
most supportive vlr user
Prancer [#23]most supportive vlr user
Thank you ☺️
SOURVLRT [#11]match case looks cleaner though
No it doesn't python code should be written the pythonic way which for such problems, match case just doesn't look good. Also, it is really redundant and only increases the headaches of people looking at the code.
SOURVLRT [#9]age = 65
match age:
case if age < 18:
print("Minor LMAO😹")
case if 50 <= age < 60:
print("Ancient AAAH")
case _:
print("Only ashes left💀")here you go bud, cleaner code
if you try writing this correctly with match-case, you will end up writing if statements within the cases, and at that point you can't call it cleaner
LingWang [#17]
Bro got the Drake codebase
this is trash u should be ashamed of yourself
Not bad for a first timer
any programmers out here wanna tell me how to start out with java? any specific courses to learn from?
i got some experience in python and c# but only basics for uni
omegaishere [#30]any programmers out here wanna tell me how to start out with java? any specific courses to learn from?
i got some experience in python and c# but only basics for uni
Udemy course: Learn JAVA Programming - Beginner to Master by Abdul Bari
you can try using input()
zappp [#31]Udemy course: Learn JAVA Programming - Beginner to Master by Abdul Bari
thnx