Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

frequency

#take user input
String = input('Enter the string :')
#take character input
Character = input('Enter character :')
#initiaalize int variable to store frequency
frequency = 0
#use count function to count frequency of character
frequency = String.count(Character)
#count function is case sencetive 
#so it print frequency of Character according to given Character
print(str(frequency) + ' is the frequency of given character')
Comment

Frequency

printf("Enter n: ");
  scanf("%d", &n);
  
  int elem[n];
  
  printf("Enter elements: 
");
  
  for(x=0; x<n; x++){
  
  scanf("%d", &elem[x]);
  }
  
  int y;
  
  printf("Enter y: ");
  scanf("%d",&y);
  
  for(z=0; z<n; z++){
  
  		if(elem[z]==y){
  			count++;
		  }
  
  }
      printf("FREQUENCY: %d",count);
Comment

PREVIOUS NEXT
Code Example
Python :: tf dataset 
Python :: make a tuple 
Python :: bitbucket rest api python example 
Python :: run pyinstaller from python 
Python :: Set .difference() Operation in python3 
Python :: python environment variable 
Python :: map dataframe 
Python :: django pytest how to load data 
Python :: opencv resize image 
Python :: youtube mp3 downloader python 
Python :: python loop until condition met 
Python :: merge sort in python 
Python :: python in 
Python :: python size of set 
Python :: python string does not contain 
Python :: python OSError: [Errno 22] Invalid argument: 
Python :: django delete model from database 
Python :: python pandas sum of series 
Python :: python inheritance 
Python :: Python String count() example 
Python :: crud python 
Python :: read yml file in python 
Python :: pip install module for specific python version 
Python :: python a, b = 
Python :: what are while loops 
Python :: matplotlib keyboard event 
Python :: python find in string 
Python :: python sleeping with a varible 
Python :: arcpy save map layer to feature class 
Python :: how write a date with th and nd in python 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =