Need help asking for an input sentence
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I need to ask the user to insert a sentence. I have
N=input('what is N?: ')
A=input('give me a sentence!: ');
Once I run the code and insert any word I get an error that says invalid expression. How can I stop the error from popping up? I will also be asking the sentence prompt to repeat until a certain word or phrase is typed.
0 Commenti
Risposte (1)
Akira Agata
il 21 Ott 2021
To input a text, you should use 's' option, like:
N = input('what is N?: ')
A = input('give me a sentence!: ','s');
0 Commenti
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!