Skip to main content

Posts

Showing posts with the label Lists_in_Python

Exploring Python Lists and Dictionaries: A Beginner's Guide

 Welcome to Techbbas_log! Today, we will delve into the basics of Python lists and dictionaries, two essential data structures in Python programming. This blog will walk you through various operations on these data structures, from creation to manipulation, with clear explanations and code examples. Working with Python Lists Python lists are ordered, mutable collections of items. Lists can contain items of different data types, including integers, strings, and even other lists. Let's explore some fundamental list operations: Creating a List fruits = ["guava", "apple", "mango", "orange", "happy"] print(fruits) Here, we have created a list named fruits and printed its contents. Finding the Length of a List print(len(fruits))     //The len() function returns the number of items in the list. Looping Through a List for fruit in fruits:     print(fruit) Using a for loop, we can iterate through each item in the list and print it. Access...

A Journey Through Basic Python Programming

  Welcome to Techbbas Log!👇  First Blog: A Journey Through Basic Python Programming Hello, fellow tech enthusiasts! Welcome to the very first blog post on Techbbas Log. Today, we are going to embark on a journey through some fundamental Python programming concepts. Whether you are a beginner or looking to refresh your knowledge, this blog will guide you through basic operations, working with lists, and manipulating data structures. Let's dive in!  Hello, World! Let's start with the classic "Hello, World!" program, which is a simple way to ensure your Python environment is set up correctly. ```python print("hello world") ```  Working with Variables In Python, you can easily assign values to variables and perform arithmetic operations. Here are some examples: ```python Assigning a number to a variable name = 150 Printing the variable print(name)  Adding a number to a variable print(name + 50) Assigning values to variables and adding them a = 10 b = 30 print(...