Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Whats my error in code

+2 votes
asked Dec 2, 2022 by Zayd Ayub (190 points)
print("lets play rock paper scissors")
now = input()
if now == rock:
    print("paper")
elif now == paper:
    print("scissors")
elif now == scissors:
    print("rock")
else:
    print("invalid answer")

2 Answers

+2 votes
answered Dec 2, 2022 by Kiran Kumar (180 points)

you have to use string comparision
double quotes is missing

if now == "rock":

0 votes
answered Dec 3, 2022 by Roshan raj (160 points)
#incloude<iostream>

usingh namespace std;

int main()

{

cout<<"paper\n";

cout<<"scissors\n";

cout<<"rock";

return 0;

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...