3

@3373_vaishnavi

Basic dict operation: deleting elements

Python
1 year ago
my_dict = {'name': 'john', 'age': 25, 'city': 'New York'} del my_dict['city'] print(my_dict)

Basic dict operation: 4.iterating

Python
1 year ago
my_dict = {'name': 'john', 'age': 25, 'city': 'New York'} for key, value in my_dict.items(): print(key, value)

Create of dictionary: using dict()

Python
1 year ago
my_dict=dict(name='john',age=25,city='New York')

Creation of dictionary: using curly braces

Python
1 year ago
my_dict={'name':'john','age':25,'city':'New York'}

Addition of two numbers

PHP
1 year ago
<?php $a=1; $b=2; $sum=$a+$b; echo "sum:".$sum;

Set difference ex.

Python
1 year ago
set1={0,2,3} set2={3,4,5} difference_result=set1-set2

Ex.Concatenation tuple

Python
1 year ago
tup1=(1,"sai") tup2=(2,"jay") result=tup1+tup2 print(result)

Py.deleting tuple

Python
1 year ago
tup=(1,2,3) del tup

Py.multiply tuple

Python
1 year ago
tuple=(1,2,3) new_tuple=tuple*3 print(new_tuple)

Py.concatenation of tuple(3m)

Python
1 year ago
tuple1=(12,34,25) tuple2=(10,20,30) tuple3=tuple1+tuple2 print(tuple3)

Append

Python
1 year ago
my_tuple=(1,"apple",3.14)

Py.while loop

Python
1 year ago
i=1 while i<=10: print("Hello all") i= i+1

Py.range fun

Python
1 year ago
a=list(range(10)) print (a)

Py. arithmetic oprators

Python
1 year ago
a=2 b=5 add=a+b sub=a-b mul=a*b div=a/b mod=a%b print("addition is:",add) print("substraction is:",sub) print("multiplication is:",mul)

Py . print the number

Python
1 year ago
x="23" y="35" sum= x+y print(sum)

Py.math fun.4.sqrt

Python
1 year ago
import math x = math.sqrt(64) print(x)

Py.math fun.3.pow

Python
1 year ago
x = pow(4,3) print(x)

Py.math fun.2.max

Python
1 year ago
x = max(5,10,25) print(x)

Py.math function.1.min

Python
1 year ago
x = min(5,10,25) print(x)

Py.count the balance

Python
1 year ago
Exp1 = 600 Exp2 = 700 Exp3 = 900 Exp4 = 1300 Exp5 = 1200 Exp6 = 1000 total_Exp = Exp1 + Exp2 + Exp3 + Exp4 + Exp5 + Exp6 amount = 10000 # Corrected to an integer value balance = amount - total_Exp