Docsity

Python Programming Notes for Beginners | Complete Guide with 100+ Practice Programs (PDF), Summaries of Computer Science

Toggle sidebar
bg1
Python Programming Language
• Python is a popular programming language.
• Python can be used on a server to create web applications.
• It was created by Guido van Rossum, and released in 1991.
It is used for:
• web development (server-side),
• software development,
• mathematics,
• system scripting.
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and
modify files.
• Python can be used to handle big data and perform complex
mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.
Why Python?
• Python works on different platforms (Windows, Mac, Linux,
Raspberry Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a

Partial preview of the text

Download Python Programming Notes for Beginners | Complete Guide with 100+ Practice Programs (PDF) and more Summaries Computer Science in PDF only on Docsity!

Python Programming Language

  • Python is a popular programming language.
  • Python can be used on a server to create web applications.
  • It was created by Guido van Rossum, and released in 1991.

It is used for:

  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.

What can Python do?

  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
  • Python can be used to handle big data and perform complex mathematics.
  • Python can be used for rapid prototyping, or for production-ready software development.

Why Python?

  • Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
  • Python has a simple syntax similar to the English language.
  • Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
  • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
  • Python can be treated in a procedural way, an object-oriented way or a functional way.

Python Syntax:

Example:

Python List

Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage. Lists are created using square brackets: Example:

  1. pop() – Removes and returns the element at a specified index. If no index is given, it removes the last element.
  2. clear() – Removes all elements from the list, making it empty.
  3. index() – Returns the index (position) of the first occurrence of a specified value.
  4. count() – Returns the number of times a specified element appears in the list.
  5. sort() – Sorts the elements of the list in ascending order by default.
  6. reverse() – Reverses the order of elements in the list.
  7. copy() – Creates a shallow copy of the list.
  8. len() – Returns the total number of elements in the list.
  9. max() – Returns the largest element in the list.
  10. min() – Returns the smallest element in the list.
  11. sum() – Returns the sum of all numeric elements in the list.

Append & Insert: Extend:

Index: Count:

Sort: Reverse: Len:

Q1. slice the list from index 2 to 4 Q2. Find the length of list without using len( ) function

Q3. Check if element exist in list Q4. Find Second Largest Element from list

Q7. Seperate even and odd numbers

Q8. Reverse a list without using reverse()

Q2. Count Vowels in string Q3. Convert to uppercase and lowercase Q4. Concatenate two strings

Q5. Find the Length of String Q6. Check whether the string is palindrome or not

Q8. count Frequency of each character in string Q9. Replace all spaces with hypen in string

Q10. Replace all the spaces with hypen in string without using replace( )