Uncategorized

Write Java code to take user input

Java is one of the most widely used programming languages for application development, system development, game development, etc. Due to its platform independence and the multiple other features it offers, it is the first choice for people who want to learn programming. STEPS public class UserInputExample { public static void main(String[] args) { Scanner scanner = new …

Write Java code to take user input Read More »

Python Generators

Python generators provide a memory-efficient way to handle large data sets or streams of data. They are created using functions and the yield statement. Unlike regular functions that return a single value and terminate, generators can yield multiple values, pausing after each yield and resuming from there on the next call. def number_generator(n): for i …

Python Generators Read More »

Sets in python

In this tutorial we are going to discuss about the sets. Introduction: Python provides a built in function called sets. sets consists of following properties :- sets are unordered. set elements are unique. set does not allow duplicate values. sets are immutable. Example: Input: set1={“app” ,”exp “,”fox “,”dog”} print(set1) Output: {“app”, “exp”, “fox”, “dog”} Get …

Sets in python Read More »

Scroll to Top