0% found this document useful (0 votes)
7 views1 page

Code Examples for Data Operations

The document contains Python code snippets demonstrating various operations such as finding the maximum and minimum values in a list, extracting unique elements from a list, reversing a list of fruits, sorting user-inputted numbers, counting down from 700, and performing arithmetic operations on user-inputted numbers. Each section is separated by print statements indicating 'NEXT CODE'. The code showcases basic list manipulations and user interactions in Python.

Uploaded by

learner.kuttima
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Code Examples for Data Operations

The document contains Python code snippets demonstrating various operations such as finding the maximum and minimum values in a list, extracting unique elements from a list, reversing a list of fruits, sorting user-inputted numbers, counting down from 700, and performing arithmetic operations on user-inputted numbers. Each section is separated by print statements indicating 'NEXT CODE'. The code showcases basic list manipulations and user interactions in Python.

Uploaded by

learner.kuttima
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

amount = [2,4,6,7,8,88663,9,10000,498,2,30,5,699787]

max_amount = max(amount)
min_amount = min(amount)
print("Maximum amount :", max_amount)
print("Minimum amount :", min_amount)

print( )
print ("NEXT CODE")

numbers =[2,3,2,5,7,8,8,3,4,3,7,9]
unique_numbers= list(set(numbers))
print("Unique numbers are:",unique_numbers)

print( )
print ("NEXT CODE")

fruits = ["banana","apple","custard apple","strawberry"]


reversed_fruits= list(reversed(fruits))
print("Reversed list:",reversed_fruits)

print( )
print ("NEXT CODE")
numbers=[input("enter the items")] ,[input("enter the items")] , [input("enter the
items")] , [input("enter the items")]
sorted_list= sorted(numbers)
print("sorted list",sorted_list)

print( )
print ("NEXT CODE")
count=700
while count > 0:
print(count)
count -=1

print( )
print("NEXT CODE")
a = int(input("Enter a number: "))
b = int(input("Enter a number: "))
c = int(input("Enter a number: "))
print ("sum of the numbers:", a+b+c)
print ("product of the numbers:", a*b*c)

You might also like