Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

Ok, so why does ruby keep saying: error, string literal in condition.

ComputingSquid
ComputingSquid

Ok, so my repl just keeps saying: error, string literal in condition, whenever I use an if...else loop. it is sooooo anyoing. can anyone help me?

2 years ago
Answered by KobeFFView Answer

Voters

Comments

TopNew
1
KobeFF
KobeFF

O yeah, ik this is an old post, but for future reference, if this still is an issue for you, it's most likely because you forgot to use "==" instead of "=".

e.g. instead of

x = 1 if x = "2" puts "x is 2" else puts "I can't guess the number" end

try:

x = 1 if x == "2" puts "x is 2" else puts "I can't guess the number" end
2 years ago
1
ComputingSquid
ComputingSquid

um ok i know tht is really old post bruh.
also did u see my social experiment?
i got 8 cycles on a crappy python interpreter in 3 hours then coder100 made me delete it.
the only code was:

x=input("text") print(exec(x))

@KobeFF

2 years ago
1
KobeFF
KobeFF

@ComputingSquid
lol also i got a coupon for a free ".tech" domain!!! im thinking "geeksuniversal.tech"

2 years ago
1
1
KobeFF
KobeFF

@ComputingSquid
sure ill tell u when i finish the course

2 years ago
1

i understand, that happens to me too

2 years ago
Load more