当前位置: 动力学知识库 > 问答 > 编程问答 >

if statement - 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: