I am writing a program but cannot get the second line of code to activate. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am writing a program but cannot get the second line of code to activate.

s = input('Please enter username: ') print(s) Sovietwomble = 2 sovietwomble = 2 if 2==2: print('<redacted>!') else: print('You are slaves under the currylord!')

21st Apr 2017, 3:36 PM
Kolby
19 Answers
+ 13
Try it like this: username = input('Please enter username: ').lower() print(username) if username == 'sovietwomble': print('Stuff') else: print('Other stuff')
21st Apr 2017, 4:27 PM
Michael Foster
Michael Foster - avatar
+ 12
Question: who/what are Sovietwomble and the Currylord?
21st Apr 2017, 4:20 PM
Michael Foster
Michael Foster - avatar
+ 9
wait are you trying to have the user enter the value for sovietwomble
21st Apr 2017, 4:09 PM
Supersebi3
Supersebi3 - avatar
+ 9
the code would be: s = input() if s == "Sovietwomble" or s == "sovietwomble": # womble is faggot code else: # currylord code
21st Apr 2017, 4:14 PM
Supersebi3
Supersebi3 - avatar
+ 9
I think you completely misunderstood variables. id suggest you to go through the course again
21st Apr 2017, 4:17 PM
Supersebi3
Supersebi3 - avatar
+ 9
@Kolby in the last code you posted theres just a : missing after the line
21st Apr 2017, 5:07 PM
Supersebi3
Supersebi3 - avatar
+ 8
do you mean the print(s) or the thing in the else?
21st Apr 2017, 3:46 PM
Supersebi3
Supersebi3 - avatar
+ 8
that doesnt execute because the if statement 2==2 is true. else only executes if the corresponding if didnt execute
21st Apr 2017, 3:56 PM
Supersebi3
Supersebi3 - avatar
+ 8
instead of checking if 2==2, check if Sovietwomble==sovietwomble
21st Apr 2017, 4:03 PM
Supersebi3
Supersebi3 - avatar
+ 4
Man, why would you ever want to run this? ;) Try thinking of a real logic condition that might be False or True, depending on the value of s (the user input). 2==2 will always be True
21st Apr 2017, 4:10 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
if s=='Sovietwomble': (rest of code) * I never thought I'd write this :)
21st Apr 2017, 4:13 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Lose the variables. Enter "if s.lower() == 'sovietwomble':"
21st Apr 2017, 4:14 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
What i am trying to do is if they enter Sovietwomble it prints "womble is a faggot". But if they enter anything else it prints "you are all slaves under the curry lord"
21st Apr 2017, 4:12 PM
Kolby
+ 1
Yeah realized that
21st Apr 2017, 5:08 PM
Kolby
0
The thing in else
21st Apr 2017, 3:55 PM
Kolby
0
Ok but what do i need to do to execute it if i do not enter S/sovietwomble
21st Apr 2017, 4:02 PM
Kolby
0
But i do not enter sovietwomble it still prints "Womble is a faggot."
21st Apr 2017, 4:07 PM
Kolby
0
I use two versions in case if they hypothetically write sovietwomble instead of Sovietwomble.
21st Apr 2017, 4:13 PM
Kolby
0
Thank you. I will do so.
21st Apr 2017, 4:15 PM
Kolby