DAY 4 🚀 #30daysofcoding PYTHON Q : WORD COUNT Write a program that reads a sentence S and prints the frequency of each word in the given sentence. Note.. 📒 If the given sentence S is Hello world Hello, * The frequency of Hello in the given sentence is twice. * The frequency of world in the given sentence. Input 👈 ------ The input will be a single line containing a string representing a sentence 'S'. Output 👈 ------- The output should be multiple lines with each line containing a word and its frequency in the given sentence seperated by colon-character ( : ) with the order of appearance in the given sentence. #python #ccbp #nxtwave #30daysoflearning
More Relevant Posts
-
⚡ Python Day 2: f-strings = Formatted Superpowers! Just learned how f-strings make Python string formatting elegant and powerful: ✨ What I can now do: • Embed variables directly: `f"Hello, {name}!"` • Perform math in strings: `f"Total: ${price * quantity:.2f}"` • Debug easily: `f"{variable=}"` shows name AND value • Format numbers professionally: `f"${amount:,.2f}"` Key takeaway: f-strings are readable, fast, and eliminate messy concatenation. #Python #Day2 #FStrings #Programming #CodingChallenge #LearnToCode
To view or add a comment, sign in
-
-
Python tips: how to detects duplicate files ? As a folder grows, duplicates start to quietly take up space, especially if you save the same files under different names. A quick method in Python is to calculate the hash of each file and group them into categories based on their hash. This way, you can immediately identify files with identical content, not just by names. #python #pep #algorithms
To view or add a comment, sign in
-
-
📘 Day 4 – Python Learning Progress Today’s focus was on operators and conditional logic, which are essential for decision-making in Python programs. 🐍 What I practiced today: Arithmetic operators (+, -, *, /, %) Comparison operators (>, <, ==, !=) Logical operators (and, or, not) Writing programs using if–else conditions (even/odd, largest of numbers) Building logic step by step and improving problem-solving skills through practice. #PythonLearning #ProgrammingBasics #LogicBuilding #DailyPractice #Upskilling “Practicing basics every day to build strong foundations before moving to advanced topics.”
To view or add a comment, sign in
-
Python collections are data structures that store multiple values, making it easier to work with and manipulate data. The main collections are: ➡️Lists: ordered, mutable (changeable) ➡️Tuples: ordered, immutable ➡️Dictionaries: key-value pairs, mutable (tho not included in the exercise below) ➡️Sets: unordered, unique elements, mutable These collections help you organize and process data efficiently. #python #programminglanguage #coding
To view or add a comment, sign in
-
🐍 90 Days of Python – Day 21 Sets in Python Today, I learned about sets in Python, a data structure used to store unique and unordered elements. Sets are especially useful when working with data that should not contain duplicates and when checking membership efficiently. 🔹 Key concepts I explored today: • Creating sets using set() • Understanding how sets handle unique values • Adding and removing elements • Using sets for membership testing and data cleaning Sets are commonly used in data preprocessing, analytics, and performance-critical operations where uniqueness matters. I’m practicing these concepts to better understand how Python handles collections efficiently. 📌 Day 21 completed. Managing unique data with sets. 👉 In which scenario do you think sets are more useful than lists? #90DaysOfPython #PythonLearning #LearningInPublic #PythonSets #PythonDeveloper #BTechCSE
To view or add a comment, sign in
-
-
22nd's Python Class – Anonymous (Lambda) Functions In a recent Python session, we learned about anonymous (nameless) functions and how they make code shorter and more expressive. 🔹 Understanding Lambda Functions Learned that lambda functions are single-line, nameless functions Used the lambda keyword instead of def Followed the syntax: lambda arguments : expression 🔹 Lambda vs Normal Functions Compared traditional functions using def with lambda expressions Understood that: return ends a function Lambda functions automatically return the expression result 🔹 Practical Examples Performed arithmetic operations using lambda: 2*x + 5 Multiplication of two numbers Took user input and passed values directly to lambda functions Used lambda functions for string operations like converting text to uppercase 🔹 Working with Characters Used ord() to display ASCII values of characters from user input Combined iteration and built-in functions with lambda logic This class helped me understand how lambda functions can simplify code while keeping it clean and efficient 🚀 #Python #LambdaFunctions #AnonymousFunctions #PythonBasics #FunctionalProgramming #CodingPractice #StudentLearning Pooja Chinthakayala
To view or add a comment, sign in
-
-
🐍 Week 6 Progress Report - Refining Python Skills 🐍 In Week 6, I worked through the fundamentals of regular expressions using Python’s built-in 𝗿𝗲 module! Working with Python’s regex implementation helped strengthen my understanding of how these patterns work! Topics I worked through: - Differences between 𝗿𝗲.𝘀𝗲𝗮𝗿𝗰𝗵 and 𝗿𝗲.𝗳𝘂𝗹𝗹𝗺𝗮𝘁𝗰𝗵. - Using the IGNORECASE flag to make searches case-insensitive. - The special sequence "\d" for matching digits. - Metacharacters, specifically the "+" quantifier, and how patterns like "\d" vs. "\d+" produce very different results. (Shown in the image) If regex was challenging for you, what helped make it click? 🙂 #Python #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
Single-threaded scripts are too slow. Python's `multiprocessing` or `asyncio` is mandatory for large datasets. Scraping 1 URL = 1 second. Scraping 10,000 URLs sequentially = 3 hours. Scraping 10,000 URLs with 10 workers = 18 minutes. Learn concurrency. Asyncio or Threading? What do you use? #python #performance #coding #scaling
To view or add a comment, sign in
-
Today I learned about Operators in Python 🐍 Operators are symbols that tell Python what action to perform on values and variables. They may look small, but they are everywhere in real programs : ➕ Adding numbers ➖ Subtracting values 🔍 Comparing results 🧠 Applying logic 📦 Assigning data Some common types I studied today : • Arithmetic operators (+ - * / %) • Comparison operators (== != > < >= <=) • Logical operators (and, or, not) • Assignment operators (= += -= *=) • Bitwise operators (& | ^ ~ << >>) • Membership operators (in, not in) Understanding operators makes it much easier to write conditions, loops, and real-world logic in Python. Still learning step by step — consistency over perfection 💪 #Python #DataScience #LearningInPublic #Programming #100DaysOfCode #CareerSwitch
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development