+ 1
I need help making a simple python program
Its a sad program that prints ('are you sad') and if you press Y it spams (i am sad) please help me
18 odpowiedzi
+ 10
The python course contains all the knowledge you will require.
https://www.sololearn.com/learn/Python/2428/?ref=app
https://www.sololearn.com/learn/Python/2426/?ref=app
https://www.sololearn.com/learn/Python/2277/?ref=app
https://www.sololearn.com/learn/Python/2435/?ref=app
+ 12
spam = input("Are you sad? ")
print(spam + "\n")
if spam == "yes":
for x in range(0,20):
print("You are sad")
+ 9
If you keep going with your python course you should have no problems creating such a program.
You will want to study user input, conditional statements and loops
+ 7
I will get you started:
spam = input("Are you sad? ")
+ 5
Adrian: Go to your python course, and click 'Basic Concepts.' There is SImple Input and Output. Then in Control Structures, go to anything with loop in it.
+ 4
Can you show me what you have so far??
I think you need to import a module for key detection... Im not sure which one, though.
Why do you want to create such a program, though :P
+ 3
Hey jay, those pages can't be found...
+ 3
Huh, it said those pages cannot be found for me...
+ 3
Alright, cool! If you require any more assistance, I am here! :)
+ 3
Try this...
spam = input('ARE YOU SAD? ')
if spam == 'yes':
print('You are sad')
else:
print('You are not sad')
The else statement is optional, you don't need it. But keep in mind that if the word YES is not an exact match to what the user types, it won't work. You can add to the if statement or add elif statements to account for other variations, like a capital Y, or all caps - YES. To make it spam the phrase, just multiply the print statement, like this...
print('You are sad ' * 10)
Side note: Finish the Python course and this should be no problem for you.
+ 2
Can I see the code?
You should just be able to do a while loop or if statement with user input.
+ 1
Were may i find this jay
+ 1
Thx jay
+ 1
DrChicken24 works just fine for me
+ 1
Im working on it rn just editing some things atm DrChicken24
0
ok if i want them to input yes how do i make it spam i am sad ?
0
DrChicken24 yea
print("ARE YOU SAD ?")
spam = input (" ")
print (spam)
i just help to where they reply yes and it spams Your are sad
0
synorax yea i had this at first but all it gave me an eoi error an error ive never seen