vendredi 24 février 2017

Basic python: having the user give a letter, and examin if the letter occures in the string

Create a script that examines a string “Geographic Information Science” for the occurrence of a particular letter.

Ask your user to give a letter and store it in a variable x. If the letter occurs in the text (for example, the letter S), the string “Yes” should be printed to the Interactive Window. If the letter does not occur in the text (for example, the letter Z), the string “No” should be printed.

Aucun commentaire:

Enregistrer un commentaire