Exercise 1: Basic Calculator Lab Exercise Instructions: Create a new Python file called calculator.py Implement the calculator program following these steps: First, ask the user to input an operator Then, ask for two numbers Use conditional stat...
🔹 Question 1: Greet User Write a function called greet_user that takes a name as input and prints a greeting message like "Hello, Areeff!". 🔹 Question 2: Add Two Numbers Write a function called add_numbers that takes two numbers and returns their ...
🔹 Exercise 1: Working with Lists Write a program that: Creates a list of 5 numbers Adds a new number to the list Removes the second number Prints the list 🔹 Exercise 2: Conditions with Loops Create a list of numbers from 1 to 10. Use a for l...
🔹 Exercise 1: Create a Dictionary Create a dictionary named student with the following key-value pairs: name: "John" age: 20 course: "Computer Science" Then print the dictionary. 🔹 Exercise 2: Access and Update Values Using the student dictio...
List Exercises: Create and Access List Create a list called fruits containing "apple", "banana", "cherry", and "date". Print the second item in the list. Change the third item to "blueberry" and print the updated list. List Operations Given t...
Lab Practical 1: Introduction to Java Programming Objective: Write a simple Java program to print "Hello, World!" and compile/run it using the command line.Task: Write a Java program that prints "Hello, World!". Compile and run it using javac and j...
🔹 Section 1: Variables, Output, Input Q1. Create and Display Create a variable called name and assign your name to it. Print: Hello, [name]! Q2. Simple Calculator Ask the user for two numbers. Add them and print the result. 🔹 Section 2: i...
1. Password Checker Keep asking until user enters "admin123". Then print “Access Granted”. 2. Countdown from N Ask for a number, then count down to 0. 3. Number Until Even Keep asking the user for a number until they enter an even number. 4. Sum Unti...
1. Print 1 to 10 Use a for loop to print numbers 1 to 10. 2. Sum of 1 to 100 Use a for loop to calculate the sum of numbers from 1 to 100. 3. Print Multiples of 3 (1–30) Print all multiples of 3 between 1 and 30. 4. Print Each Character Ask the user ...