A

@Arpita3025

hello.py

Python
1 month ago
print('Hello world!') print("aru") num=2 if(num>2): print("greater than 2") if(num>3): print("greater than 3")

travelling salesmN

C++
1 year ago
#include <iostream> #include <vector> #include <climits> using namespace std; int tsp(vector<vector<int>>& dist, vector<vector<int>>& dp, int mask, int pos, int n) { if (mask == ((1 << n) - 1)) return dist[pos][0]; if (dp[mask][pos] != -1) return dp

travelling salesmN

C
1 year ago
#include <iostream> #include <vector> #include <climits> using namespace std; int tsp(vector<vector<int>>& dist, vector<vector<int>>& dp, int mask, int pos, int n) { if (mask == ((1 << n) - 1)) return dist[pos][0]; if (dp[mask][pos] != -1) return dp

quicksort

C++
1 year ago
#include <iostream> using namespace std; int Partition(int arr[], int l, int h) { int pivot = arr[l]; // Choose the pivot int i = l + 1; // Start i from the next element int j = h; while (i <= j) { // Change condition to include eq

mapreduce.adbms

MongoDB
2 years ago
db.Orders.insertMany([{custid:"A123",amount:3000,status:"A"},{custid:"A123",amount:600,status:"A"},{custid:"A123",amount:7000,status:"A"}]); db.Orders.mapReduce(function(){emit(this.custid,this.amount);},function(custid,amt){return Array.sum(amt)},{

dbms

MongoDB
2 years ago
show dbs use shopping show collections db.Product.find().limit(2) db.Product.find().limit(1) db.Product.find().sort({key:1}) db.Product.find({},{"Productname":1,_id.0}).sort({"Productname":1}) db.Product.find({},{"Productname":1,"Price":1,_id:0}).s

IT2147 ADBMS

MongoDB
2 years ago
use shopping db show dbs use shopping1 show dbs db.dropDatabase() show dbs use shopping db.createCollection("product") use shopping

IT2147 ADBMS

MongoDB
2 years ago
use shopping db show dbs use shopping1 show dbs db.dropDatabase() show dbs use shopping show dbs use shopping

IT2147 ADBMS

MongoDB
2 years ago
show dbs use shopping show collections db.product.find().limit(2) db.product.find().limit(1) db.product.find().sort({key:1}) db.product.find({},{"productname":1,_id:0}).sort({"productname":1}) db.product.find({},{"productname":1,"price":1,_id:0}).s

python.calculator

Python
2 years ago
a=4 b=3 def calculator (a,b): print("addition:",a+b) print("subtraction:",a-b) print("multiplication:",a*b) print("division:",a/b) calculator(2,9) calculator(4,8)

T.py

Python
2 years ago
# Python program to draw square # using Turtle Programming import turtle skk = turtle.Turtle() for i in range(4): skk.forward(50) skk.right(90) turtle.done()

Another Method to create sets in Python

Python
2 years ago
# Another Method to create sets in Python3 # Set containing numbers my_set = {1, 2, 3} print(my_set)

Creating a Set with a List of Numbers.py

Python
2 years ago
# Creating a Set with # a List of Numbers # (Having duplicate values) set1 = set([1, 2, 4, 4, 3, 3, 3, 6, 5]) print("\nSet with the use of Numbers: ") print(set1) # Creating a Set with

creating a set .py

Python
2 years ago
# Python program to demonstrate # Creation of Set in Python # Creating a Set set1 = set() print("Initial blank Set: ") print(set1) # Creating a Set with # the use of a String

converting list into tuple

Python
2 years ago
# Python3 program to convert a # list into a tuple def convert(list): return tuple(list) # Driver function list = [1, 2, 3, 4] print(convert(list))

a program to print alphabet pyramid patterns.py

Python
2 years ago
def print_alphabet_pyramid(rows): ascii_value = 65 # ASCII value of 'A' for i in range(1, rows + 1): for j in range(1, rows - i + 1): print(" ", end="") for k in range(1, 2 * i): print(chr(ascii_value

Print Multiplication Table of a Given Number:py

Python
2 years ago
def print_multiplication_table(number): for i in range(1, 11): print(f"{number} x {i} = {number * i}") # Example usage: num = int(input("Enter a number to print its multiplication table: ")) print_multiplication_table(num)

Swap Two Numbers:py

Python
2 years ago
def swap_numbers(a, b): return b, a # Example usage: num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) num1, num2 = swap_numbers(num1, num2) print(f"After swapping: First number = {num1}, Second number = {

Convert Kilometers to Miles: python

Python
2 years ago
def convert_km_to_miles(km): miles = km * 0.621371 return miles # Example usage: kilometers = float(input("Enter distance in kilometers: ")) miles = convert_km_to_miles(kilometers) print(f"{kilometers} kilometers is equal to {miles} miles")

Calculate Square Root and Cube Root of a Given Number.py

Python
2 years ago
import math number = float(input("Enter a number: ")) square_root = math.sqrt(number) cube_root = number**(1/3) print(f"Square root of {number} is: {square_root}") print(f"Cube root of {number} is: {cube_root}")