Please enable JavaScript to use CodeHS

Utah Introducción a Python 2

Description

En esta lección, los alumnos repasan los conceptos y comandos con los que deben estar familiarizados antes de empezar el curso. Completan algunos retos de Tracy por su cuenta y luego tienen la oportunidad de trabajar con un compañero para crear un proyecto más amplio, con andamiaje, desarrollando una plataforma de arte digital.

Objective

Students will be able to:

  • Review the following concepts:
    • for loops
      • using i as a variable
      • using extended parameters for stop and increment
    • commenting
    • functions
      • parameters
      • return values
    • data types and casting
    • formatting strings
      • escape sequences
      • concatenation
      • format
    • user input
    • clickable interaction
    • if/elif/else statements
    • while loops
      • forever loops using break
  • Review the following commands:
    • forward
    • circle
      • with and without extended parameters for extent and steps
    • penup
    • pendown
    • goto / setposition
    • setx
    • sety
    • left
    • right
    • setheading / seth
    • bgcolor
    • speed
    • color
      • using color names and hex codes
    • begin_fill / end_fill
    • pensize
    • write
    • type
    • print
    • String methods:
      • capitalize
      • upper
      • lower
      • isalpha
      • isdigit / isnumeric
      • isupper
      • islower
      • startswith
      • endswith
    • input
    • onclick
    • getscreen
    • return
    • break
Description

En este proyecto, los alumnos trabajan con un compañero para crear una plataforma de arte digital. Seguirán pasos andados, pero también se les dará la oportunidad de incluir algunas ideas y diseños propios y verán lo que se necesita para trabajar con éxito con otro alumno mientras programan.

Objective

Students will be able to:

  • Synthesize concepts and skills they should be comfortable with to create a project with a partner
  • Gain experience programming with a partner
Description

En esta lección, los alumnos se familiarizan con las listas. Aprenderán por qué se utilizan las listas en los programas y cómo crearlas. Las listas se crean así:

nombre_lista = [elemento_1, elemento_2, elemento_3, ...]
Objective

Students will be able to:

  • Explain why lists are useful in programs
  • Create lists with items of various types
Description

En esta lección, los alumnos aprenden el sistema de indexación positiva y negativa de las listas y cómo se accede a los elementos de una lista.

Objective

Students will be able to:

  • Provide two index values (positive and negative) for any item in a list
  • Access individual items in a list using index values
Description

En esta lección, los alumnos aprenden a actualizar elementos de listas utilizando el valor índice del elemento.

Objective

Students will be able to:

  • Use the index value of an item to update the contents of the item in a list
Description

En esta lección, los alumnos aprenderán varias formas de añadir elementos a una lista existente mediante los métodos insert, extend y append.

Objective

Students will be able to:

  • Use the append method to add a new item to the end of a list
  • Use the extend method to add new items to the end of a list
  • Use the addition operator (+) to add two lists together
  • Use the insert method to add a new item at a specific index in a list
Description

En esta lección, los alumnos aprenderán varias formas de eliminar elementos de una lista existente utilizando los métodos pop y remove y la palabra clave del.

Objective

Students will be able to:

  • Use the pop method with no argument to remove an item from the end of a list
  • Use the pop method to remove an item from a specific index in a list
  • Use the remove method to remove a specific item from a list
  • Use the del keyword to remove an item from a specific index in a list
Description

En esta lección, los alumnos aprenden a utilizar dos nuevos métodos, clasificar y invertir, para modificar elementos de una lista.

Objective

Students will be able to:

  • Use the sort method to organize items in a list by value
  • Use the reverse method to reverse the order of items in a list
Description

En esta lección, los alumnos repasan los contenidos con un Cuestionario de Fin de Unidad de 10 preguntas.

Objective

Students will be able to:

  • Prove their knowledge of the following commands and concepts through a multiple choice quiz:
    • Creating lists (list_name = [item_1, item_2, ...])
    • Index values
    • Accessing list items (list_name[index])
    • Updating list items (list_name[index] = new_value)
    • Adding list items using:
      • append
      • extend
      • insert
      • +
    • Removing list items using:
      • pop
      • remove
      • del
    • Using additional list methods:
      • sort
      • reverse
Description

En esta lección, los alumnos exploran el concepto de archivos, comprenden la finalidad y las ventajas de la E/S de archivos y la comparan con el uso de una estructura de datos de lista, adquiriendo una comprensión de alto nivel de cómo se almacenan, acceden y comparten los datos en un ordenador.

Objective

Students will be able to:

  • Understand the concept of File I/O and its importance in computer science
  • Define what a file is and how it relates to data storage
  • Differentiate between File I/O and using a list data structure
  • Explain the benefits and use cases of File I/O
Description

En esta lección, los alumnos aprenden a leer todos o un número determinado de caracteres de un archivo utilizando Python.

Objective

Students will be able to

  • Understand the importance of reading files and the role it plays in file handling tasks.
  • Use the open() function to open a file in read mode and the close() method to close the file properly.
  • Read the entire contents of a file using the read() method and store them in a variable
Description

En esta lección, los alumnos aprenden a utilizar el método readline() para leer líneas de un archivo.

Objective

Students will be able to:

  • Understand the purpose and usage of the readline() method in Python for reading lines from a file.
  • Demonstrate how to open a file and use readline() to read a single line at a time.
  • Implement a loop to read and process multiple lines from a file using readline().
  • Adapt the readline() method to solve practical problems and perform operations on each line read from a file.
Description

En esta lección, los alumnos aprenden a utilizar el método readlines() de Python para leer varias líneas de un archivo, y practican la realización de diversas operaciones sobre la línea.

Objective

Students will be able to:

  • Understand the purpose and usage of the readlines() method in Python.
  • Read and retrieve multiple lines from a file using readlines().
  • Iterate through the lines obtained from readlines() and perform operations on each line.
  • Apply different manipulations and processing techniques to the lines read from a file.
  • Recognize the advantages and use cases of using readlines() in file handling scenarios.
Description

En esta lección, los alumnos aprenderán a escribir en archivos existentes. Explorarán dos modos: “w” para sobrescribir un archivo y “a” para añadir a un archivo.

Objective

Students will be able to:

  • Understand the purpose and importance of writing to files in programming.
  • Use the “w” mode to overwrite the contents of a file.
  • Use the “a” mode to append new data to the end of a file.
Description

En esta lección, los alumnos aprenderán a manipular la posición del puntero de un archivo utilizando el método seek() de Python. Explorarán cómo se puede utilizar buscar() para mover el puntero a una ubicación específica dentro de un archivo, permitiendo operaciones en las posiciones deseadas.

Objective

Students will be able to:

  • Understand the concept of a file pointer and its role in reading and writing data.
  • Use the seek() method to move the file pointer to a specific position within a file.
  • Perform reading operations at a desired file pointer position.
  • Identify and handle potential errors or exceptions related to seek() operations.