Computer Science > A-Level Question Paper > Basics about python.pdf (All)
Python Basics Python language is simple and versatile programming language.The structure and syntax of Python Code is simple as compared to many different languages like java, C++ etc . In the foll... owing examples you can easily understand the concept of python basics including python for loop, print statements,logical operators and predefined functions of the python libraries. Example#1: Write to initialize the given list and print its length/ count of elements. l = [13, 99, 6, 76, 11, 83, 27, 84, 28, 67, 66, 22, 96, 46, 63, 21, 65, 48, 8, 14 , 84, 22, 28, 11, 83, 87, 11, 76, 6,83,27] Example#2 Write a python code to find the Maximum element of the list l. l = [13, 99, 6, 76, 11, 83, 27, 84, 28, 67, 66, 22, 96, 46, 63, 21, 65, 48, 8, 14 , 84, 22, 28, 11, 83, 87, 11, 76, 6,83,27] Code: _max = float(“-inf”) i = 0 while i<len(l): if l[i]>_max: _max = l[i] i+=1 print _max Example#3 Write a python code to find the Minimum element of the list l. l = [13, 99, 6, 76, 11, 83, 27, 84, 28, 67, 66, 22, 96, 46, 63, 21, 65, 48, 8, 14 , 84, 22, 28, 11, 83, 87, 11, 76, 6,83,27 [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Mar 23, 2024
Number of pages
4
Written in
This document has been written for:
Uploaded
Mar 23, 2024
Downloads
0
Views
42
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·