Featured Posts

CS50 Python , Nutrition Facts Table

Image
Nutrition Facts: Python Practice for Beginners Nutrition Facts Table for Python Practice Welcome to this comprehensive guide for Python beginners! If you are learning how to work with lists, dictionaries, and loops, this post will help you build practical skills using a real-world example: nutrition facts for fruits. Understanding how to organize and manipulate data is a key part of programming, and this exercise will give you hands-on experience. Below is a sample table of fruits and their calorie values, formatted as a Python list of dictionaries. This structure is ideal for coding exercises, projects, or even building your own nutrition calculator. You can expand this list, add new fruits, or use it as a foundation for more advanced Python tasks. Python List of Dictionaries Example: fruits = [ {'name': 'Apple', 'calories': 130}, {'name': 'Avocado', 'calories': 50}, {'name': 'Banana', 'ca...

The Mystery of Conditionals - If Conditional

Conditionals

The Four Conditionals

What are Conditionals?

Conditionals are sentences that generally consist of two clauses, one which is dependent on the other.

So; The conditional sentence - any conditional sentence - has two parts: 

If Clause  +  ,  +  Main Clause

If  you heat water to 100 degrees, | it boils. ⟹⏩ if clause | main clause

Water boils | if you heat it to 100 degrees. ⟹ ⏩ main clause | if clause  

🌞 Order is not important. The "Main Clause" can come before "if clause", only you will not use a "comma" in this case.

How many forms of conditional?

The Four Forms of Conditional

  • Zero Conditional
  • First Conditional
  • Second Conditional
  • Third Conditional

ZERO CONDITIONAL

Usage:

- General truths

- General habits 

Zero Conditional - Structure
If ClauseMain ClauseExamples
Present simplePresent simple- If it rains, I wear a coat.
- If you heat metal, it expands.
- If you mix red and blue, you get purple
- Ice melts if you heat it.

FIRST CONDITIONAL

Usage:

- Possibly or likely things in the present or future.

First Conditional - Structure
If ClauseMain ClauseExamples
Present simpleFuture Simple
(Will + infinitive)
- If it rains, I will wear a coat.
- If it is sunny, I will go to the beach.
- If you eat too many chips, you will get fat.
- If I have extra money, I will invest it.

SECOND CONDITIONAL

Usage:

- Impossible things in the present.  Hypothetical unreal situations.

Second Conditional - Structure
If ClauseMain ClauseExamples
Past simpleWould                      
       Could   +  Infinitive     
might                     

- If I won the lottery, I would give you all the money.
- If I had the time, I would learn Spanish.
- I would be famous if I played in a big team.
- If I had extra money, I would invest it.

THIRD CONDITIONAL

Usage:

- Impossible unreal situations in the past that usually indicate regret.

Third Conditional - Structure
If ClauseMain ClauseExamples
Past PerfectWould + Perfect
(Would+have+P.P.)
- If she had studied, she would have passed the exam.
- If you had told me you needed a ride, I would have left earlier.
- If we had taken a taxi, we wouldn't have missed the plane.


See you with the Test On Conditionals .. Good luck.

Comments

Popular posts from this blog

فرصتك للدراسة في ألمانيا: منحة ممولة بالكامل لطلاب الدراسات العليا

How to Deactivate Screen Reader in Kali Linux

Murphy's Law: Expect the Unexpected

Python 3.2.1.14 LAB: Essentials of the while loop

Data Analysis Roadmap 2026: From Excel Lover to Python-Powered Analyst