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 :: cross validation sklearn 
Python :: scrapy with selenium 
Python :: converting timezones 
Python :: create an empty list in python 
Python :: regex python 
Python :: string representation of date time 
Python :: Python RegEx Subn – re.subn() Syntax 
Python :: python test framework 
Python :: python variables and data types 
Python :: convert 12 hour into 24 hour time 
Python :: index in python 
Python :: print all objects in list python 
Python :: tanh activation function 
Python :: repeat string python 
Python :: python online 
Python :: jupiter lab 
Python :: swap list 
Python :: how to use python all() function to check a list is empty or not 
Python :: python list pop equivalent 
Python :: floor function in python 
Python :: python string length 
Python :: nested dictionary python 
Python :: python fetch 
Python :: sorting in python 
Python :: what are for loops 
Python :: tkinter hide legend 
Python :: pathlib is symbolic link 
Python :: codegrepper is cool 
Python :: pandas form multiindex to column 
Python :: explained_variance_ratio kernel pca 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =