I struggle solving this... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I struggle solving this...

Q: Write a program to output the following: "Everything you can imagine is real." - Picasso The format of the output should exactly match the above text. My input: cat(“\”Everything you can imagine is real.” - Picasso”\“) Output: error I’m not sure what I did wrong there. Could someone please also explain why it suggests me to use cat instead of print? Thank you in advance

27th Sep 2021, 3:23 PM
sophia.tr07
4 Answers
+ 3
The symbols you are using are not quote symbols. If you want include quote symbol ' " ' , or special symbols, just use escape symbol before it like \" in String. This works : cat("\"Everything you can imagine is real.\" - Picasso") edit: from search I got, print() adds line numbers but cat() don't adds..
27th Sep 2021, 4:27 PM
Jayakrishna 🇮🇳
0
I think you probably want the second escaped double quote to appear after the word "real." By now, you have it after the word "Picasso"
27th Sep 2021, 4:12 PM
Ipang
0
Try this : str1 = "\"Everything you can imagine is real.\"" str2 = "- Picasso" str3 = paste ( str1,str2) cat (str3)
10th Apr 2022, 9:33 PM
Anouar Dahdah
0
JayaKrishna thans sir you help me to solve this question
8th Sep 2022, 4:48 AM
Parash Kumar Yadav
Parash Kumar Yadav - avatar