Latest Past Events

Python Tuple & List

RevivingIndia Meena bazar, Patna

What is Tuple? A tuple is a collection that is ordered and unchangeable. Tuples are written with round brackets. It is a collection of objects which ordered and immutable. Allow duplicate values. How to create Tuple? #Empty Tuple empty_tuple = () print (empty_tuple) #Single Element To write a tuple containing a single value you have to include a comma, even though there is only one value x= (50,) #mutiple element x= ("apple", “54.23", “23", "apple", “India") print (this tuple) READ OR ACCESS To access values in the tuple, use the square brackets. For multiple elements use slicing. X = (10,20,30) X X  #Range of Indexes You can use positive and negative index both. How to update Tuple? Tuples are unchangeable, that you cannot change, add, or remove items once the tuple is created. tup1 = (12, 34.56) # Following action is not valid for tuples  tup1 = 100  #throw Error How to…

Read more

RGB

What is RGB? RGB, short for Red Green Blue, is a color model used in digital imaging to represent colors on screens. It combines different intensities of red, green, and blue light to create various colors. How to use RGB Interior Lighting Art Projects Signage and Displays Gaming Stage Lighting Automotive Lighting Home Automation Prototyping Components Required: Microcontroller (Arduino) RGB Jumper Wires USB Cable Working Interface: The RGB LED is connected to the Arduino via jump wires on a breadboard. Arduino code, controls the LED's colors based on input, like touch or proximity sensors Example Code: void setup() { pinMode(8,OUTPUT); // Red led pin pinMode(9,OUTPUT); // Green led pin pinMode(10,OUTPUT); // Blue led pin } void loop() { digitalWrite(8,HIGH); // Red led ON digitalWrite(9,LOW);  // Green led OFF digitalWrite(10,LOW); // Blue led OFF delay(1000); digitalWrite(8,LOW);  // Red led ON digitalWrite(9,HIGH);  // Green led OFF digitalWrite(10,LOW);  // Blue led OFF delay(1000);…

Read more

Programming Question

RevivingIndia Meena bazar, Patna

String Programming Question What is the purpose of string indexing in Python? How do you access the first character of a string? How do you access the last character of a string using negative indexing? How do you access the second character of a string? How do you access a character at index 3 in a string? What happens if you try to access an index that is out of range in a string? How do you slice a string to get the substring from index 2 to index 5? How do you slice a string to get the first three characters? How do you slice a string to get the last three characters? How do you slice a string to get every second character? How do you slice a string to get the characters from index 2 to index 7 with a step of 2? How do you reverse…

Read more