Add content for basics section in python roadmap

pull/1469/head
Kamran Ahmed 2 years ago
parent 03b9b61926
commit 40aa50ef72
  1. 12
      content/roadmaps/107-python/content/100-python-basics/100-basic-syntax.md
  2. 23
      content/roadmaps/107-python/content/100-python-basics/101-variables-and-datatypes.md
  3. 8
      content/roadmaps/107-python/content/100-python-basics/102-conditionals.md
  4. 20
      content/roadmaps/107-python/content/100-python-basics/103-typecasting-exceptions.md
  5. 10
      content/roadmaps/107-python/content/100-python-basics/104-functions.md
  6. 19
      content/roadmaps/107-python/content/100-python-basics/105-lists-tuples-sets-dictionaries.md
  7. 10
      content/roadmaps/107-python/content/100-python-basics/readme.md

@ -1 +1,11 @@
# Basic syntax # Basic Syntax
Setup the environment for python and get started with the basics.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/python/'>W3Schools - Python</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=kqtD5dpn9C8'>Python for Beginners - Learn Python in 1 Hour</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.tutorialspoint.com/python/python_basic_syntax.htm'>Python Basics</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://learnxinyminutes.com/docs/python/'>Learn X in Y Minutes / Python</BadgeLink>

@ -1 +1,22 @@
# Variables and datatypes ## Variables
Variables are used to store information to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves. It is helpful to think of variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://realpython.com/python-variables'>Variables in Python</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/python/python_variables.asp'>W3Schools — Python Variables</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/python-variables/'>Python Variables - Geeks for Geeks</BadgeLink>
## Data Types
Variables in Python can be of different data types. These data types can be text (`str`), numeric (`int`, `float`, `complex`), sequence (`list`, `tuple`, `range`), mapping (`dict`), set (`set`, `frozenset`), boolean (`boolean`), binary (`bytes`, `bytearray`, `memoryview`), or none (`None`).
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/python/python_datatypes.asp'>Python Data Types</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://realpython.com/python-data-types/'>Basic Data Types in Python</BadgeLink>

@ -1 +1,9 @@
# Conditionals # Conditionals
Conditional Statement in Python perform different computations or actions depending on whether a specific Boolean constraint evaluates to true or false. Conditional statements are handled by IF statements in Python.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.guru99.com/if-loop-python-conditional-structures.html'>Python Conditional Statements: IF…Else, ELIF & Switch Case</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://realpython.com/python-conditional-statements/'>Conditional Statements in Python</BadgeLink>

@ -1 +1,19 @@
# Typecasting exceptions ## Typecasting
The process of converting the value of one data type (integer, string, float, etc.) to another data type is called type conversion. Python has two types of type conversion: Implicit and Explicit.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/python-programming/type-conversion-and-casting'>Type Conversion and Casting</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/type-casting-in-python-implicit-and-explicit-with-examples/'>Type Casting in Python with Examples</BadgeLink>
## Exceptions
Python has many built-in exceptions that are raised when your program encounters an error (something in the program goes wrong). When these exceptions occur, the Python interpreter stops the current process and passes it to the calling process until it is handled. If not handled, the program will crash.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://realpython.com/python-exceptions/'>Python Exceptions: An Introduction</BadgeLink>
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://docs.python.org/3/tutorial/errors.html'>Errors and Exceptions</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/python-programming/exception-handling'>Python Exception Handling</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/python/python_try_except.asp'>Python Try Except</BadgeLink>

@ -1 +1,11 @@
# Functions # Functions
In programming, a function is a reusable block of code that executes a certain functionality when it is called. Functions are integral parts of every programming language because they help make your code more modular and reusable.
In Python, you define a function with the `def` keyword, then write the function identifier (name) followed by parentheses and a colon.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.freecodecamp.org/news/python-functions-define-and-call-a-function/'>Python Functions – How to Define and Call a Function</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.w3schools.com/python/python_functions.asp'>Python Functions - W3Schools</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/python-functions/'>Python Functions</BadgeLink>
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://docs.python.org/3/library/functions.html'>Built-in Functions in Python</BadgeLink>

@ -1 +1,18 @@
# Lists tuples sets dictionaries # Lists, Tuples, Sets, and Dictionaries
**Lists:** are just like dynamic sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Lists need not be homogeneous always which makes it the most powerful tool in Python.
**Tuple:** A Tuple is a collection of Python objects separated by commas. In some ways, a tuple is similar to a list in terms of indexing, nested objects, and repetition but a tuple is immutable, unlike lists that are mutable.
**Set:** A Set is an unordered collection data type that is iterable, mutable, and has no duplicate elements. Python’s set class represents the mathematical notion of a set.
**Dictionary:** in Python is an ordered (since Py 3.7) [unordered (Py 3.6 & prior)] collection of data values, used to store data values like a map, which, unlike other Data Types that hold only a single value as an element, Dictionary holds key:value pair. Key-value is provided in the dictionary to make it more optimized.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=n0krwG38SHI'>Difference Between List, Tuple, Set and Dictionary in Python</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/differences-and-applications-of-list-tuple-set-and-dictionary-in-python/'>Differences and Applications of List, Tuple, Set and Dictionary in Python</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://jerrynsh.com/tuples-vs-lists-vs-sets-in-python/'>Tuples vs. Lists vs. Sets in Python</BadgeLink>

@ -1 +1,9 @@
# Python basics # Python
Python is a high-level, interpreted, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='blue' badgeText='Official Website' href='https://www.python.org/'>Official Website: Python</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://en.wikipedia.org/wiki/Python_(programming_language)'>Python Wikipedia</BadgeLink>

Loading…
Cancel
Save