top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Letters occurence Frequency

Writer's picture: Imene MaallemImene Maallem



Python is a not any language programming. It is rather universal programming language that is appropriate for solving a wide range of tasks.These days, developers are highly likely to be working on a mobile or web application. Python doesn't have built-in mobile development capabilities.Python is often used as a support language for software developers, for build control and management, testing, and in many other ways


This code was created for counting the frequency of letters occurence in a written word, phrase or expression :

We are going the input function which allows the userto enter first the word or expression :


star=input("enter the word , phrase sentence: ") 

Then we generate the same function in order to ask from the user to enter the letter which he wants to know its occurence


str=input("enter the letter you want to know its occurence :")

The print function allows to give the frequency of given letter :


print("the letter", str, "appears", star.count(str), "times")

In case the user wants to reppeat the operation , we generate the same function asking to answerr either by yes or no :


start=input("Do you want to enter new word, phrase or senstences again ?:")

Then we will use While statement in case the user wants to reuse the app :


while start== "yes":

We start from the beginingthe same operation


  star=input("enter the word , phrase sentence: ")  
  str=input("enter the letter you want to know its occurence :")
  print("the letter", str, "appears", star.count(str), "times") 
  if start != "yes"

At the end we print thank you :


    print ("Thank you!") 


Why don't you try it by yourself ? :)


star=input("enter the word , phrase sentence: ")str=input("enter the letter you want to know its occurence :")print("the letter", str, "appears", star.count(str), "times")start=input("Do you want to enter new word, phrase or senstences again ?:")while start== "yes":star=input("enter the word , phrase sentence: ")str=input("enter the letter you want to know its occurence :")print("the letter", str, "appears", star.count(str), "times")if start != "yes":print ("Thank you!")

0 comments

Recent Posts

See All

Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page