Following Assignment will Perform following operations: 1. Take a string from user and reverse it. 2. Count Number of words in the given string. 3. Count vowels,Consonents and special Charaters in the given string. 4. Reverse each word of the given string. 5. Return Largest word of the string. IDE Used:- https://www.onlinegdb.com/ 🙂 ”’ Following Assignment will Perform following operations: 1. Take a string from user and reverse it. 2. Count Number of words in the given string. 3. Count vowels,Consonents and special Charaters in the given string. 4. Reverse each word of the given string. 5. Return Largest word of the string. IDE Used:- https://www.onlinegdb.com/ 🙂 ”’ #1. This function takes input from user and reverse it. s = input(“Please Enter a Sentance: “) # initializing string print(“1. “,s[::-1]) #2. This function takes input from user and count the number of the words. u = len(s.split()) #using split() to count words in string print (“2. The number of words in string are : “ + str(u))
Category: Python
Print Function & Arithmetic Operation in Python #print Function print(‘Hello Python’) #Get Data from user #input function get data always as a string a= input(‘Enter Your Name’) print(“Welcome”,a) #Arithmetic Operation in Python a=int(input(“Enter 1st Number: “)) b=int(input(“Enter 2ns Number:”)) #Here We use int() function to get data as Integer value c=a+b d=a–b e=a*b f=a/b g=a//b #Result low to nearest whole Number h=a%b #Modulus Consider Reminder as Result i=a**b #Expontional Operator print(“Sum=”,c) print(“Subtraction=”,d)
Machine Language A computer is an electronic machine that can recognize/follow instruction written in binary form, i.e. using only 0s and 1s. Computer’s natural