Today I practiced if-else conditions by building a small program that checks whether a number is positive or negative. This time, instead of using int, I used float — so the program can handle decimal numbers as well. What I learned today: Difference between int and float Handling decimal inputs Strengthening conditional logic with if-else Even a small improvement like choosing the right data type makes the program more flexible. #Python #PythonLearning #CodingJourney #100DaysOfCode #BeginnerPython #Programming #LearningToCode #DeveloperJourney #TechGrowth #FutureDeveloper
Python if-else conditions with float inputs
More Relevant Posts
-
Today I practiced on a classic problem — checking whether a year is a leap year. This task helped me understand how multiple conditions work together using logical operators. What I practiced: if / elif / else conditions Logical operators (and, or) Writing clean and efficient logic It’s interesting how a simple real-world rule can turn into a logical program. #Python #PythonLearning #CodingJourney #100DaysOfCode #Programming #BeginnerPython #DeveloperJourney #ProblemSolving #LearningToCode **Can this logic be written in a more optimized or cleaner way?
To view or add a comment, sign in
-
-
🚀 Excited to share my new project: **Simple Calculator (Python)** I built a command-line calculator that performs basic operations like addition, subtraction, multiplication, and division. It also includes input validation and divide-by-zero handling. 🔧 Technologies Used: • Python • Functions • Error Handling This project helped me understand program structure and clean function design. 💻 GitHub: https://lnkd.in/gkASWMCw #Python #Programming #StudentProject #Coding #SoftwareDevelopment
To view or add a comment, sign in
-
Think of a class as a blueprint of a house. The blueprint isn't a house. But you can build 100 houses from it. Each house has its own color, size, and owner. That's exactly how classes and objects work in Python. Day 22/50 - Classes & Objects #Python #OOP #Classes #Objects #50DaysOfPython #Day22 #Programming #LearnPython
To view or add a comment, sign in
-
📌 NumPy Built-in Methods NumPy provides several built-in functions to quickly create arrays. 🔹 arange() – Creates an array with a range of numbers np.arange(0,10) 🔹 zeros() – Creates an array filled with zeros np.zeros(3) np.zeros((5,5)) → creates a 5×5 matrix of zeros 🔹 ones() – Creates an array filled with ones np.ones(3) np.ones((3,3)) → creates a 3×3 matrix of ones These built-in methods make array creation fast and efficient in NumPy. #Python #NumPy #Programming #DataAnalytics #LearningPython
To view or add a comment, sign in
-
-
🎲 Can You Guess the Number? Built a simple and interactive Number Guessing Game using Python that challenges the user to guess a randomly generated number between 1 and 100. 🔹 Key Features: ✔ Random number generation using random module ✔ Continuous user input with loop control ✔ Smart hints (Too High / Too Low) ✔ Tracks number of attempts ✔ Ends when correct number is guessed 🛠 Concepts Applied: • While Loop • Conditional Statements (if-elif-else) • Random Module • User Input Handling • Basic Game Logic 💡 This project helped me strengthen my understanding of control flow and logical decision-making in Python. 🔗 GitHub: https://lnkd.in/gmHCuP-w #Python #NumberGuessingGame #Programming #SoftwareDevelopment #BCAStudent #LearningJourney
To view or add a comment, sign in
-
-
Many beginners confuse these two. ✔ List [ ] Mutable Can add, remove, modify items ✔ Tuple ( ) Immutable Faster and safer for fixed data Choosing the correct structure makes your code cleaner and more efficient. What do you use more in Python — List or Tuple? #PythonDeveloper #CodingTips #BackendDevelopment #FastAPI #Programming
To view or add a comment, sign in
-
-
Day 13 at QSpiders 🚀 Today’s focus: More problem-solving using while loops 🧠 Practiced writing logic for: Pattern-based problems Divisibility checks Prime number logic GCD/HCF programs Understanding how loops actually work step by step is helping me build strong fundamentals in programming. Consistency > Motivation 💯 #Day13 #QSpiders #Python #WhileLoop #LearningJourney #ProblemSolving #FutureDeveloper
To view or add a comment, sign in
-
📚 Today I learned about While Loops! A while loop runs a block of code repeatedly as long as a condition is TRUE. python i = 1 while i <= 5: print(i) i += 1 Output: 1 2 3 4 5 Simple but super powerful! 💡 Key takeaways from today: ✅ Condition is checked BEFORE every iteration ✅ Always update the variable to avoid infinite loops ✅ Perfect when you don't know how many times to loop Day by day, concept by concept — that's how we grow! 💪 #TodayILearned #Coding #Python #Programming #LearnToCode #Developer
To view or add a comment, sign in
-
📌 NumPy Array Attributes & Methods NumPy arrays provide several attributes and methods that help us work with data efficiently. Example arrays: arr = np.arange(25) ranarr = np.random.randint(0,50,10) Here: • arr creates an array with values from 0 to 24 • ranarr creates 10 random integers between 0 and 50 These arrays can then be used to explore different NumPy array attributes and methods for data analysis and numerical computations. #Python #NumPy #Programming #DataAnalytics #LearningPython
To view or add a comment, sign in
-
-
📘 Day 23 of my #90DaysPythonChallenge Today, I worked on more interview-focused and logic-building problems in Python. 🔹 Practiced anagram checking without built-in shortcuts 🔹 Solved leader and majority element problems 🔹 Implemented stack logic for balanced parentheses 🔹 Explored bitwise logic (Power of 2 check) Each day, I’m strengthening my problem-solving mindset and understanding of core algorithms. 🚀 📂 Practice code available on GitHub: https://lnkd.in/dnNfeh_f #Python #90DaysPythonChallenge #LearningInPublic #CodingJourney #ProblemSolving #Programming
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