0% found this document useful (0 votes)
17 views12 pages

Sobre Mi - Proyectos Raspberry Pi

Uploaded by

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

Sobre Mi - Proyectos Raspberry Pi

Uploaded by

Andres Lopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

18/1/2021 Sobre mi | Proyectos Raspberry Pi

Proyectos

Sobre mí

Utilice el lenguaje de programación Python para crear

imágenes a partir de texto

Paso 1 Introducción

En este proyecto, aprenderá a escribir un programa en Python que le cuente a la gente todo sobre usted.

Que vas a hacer

Lo que vas a aprender

Este proyecto cubre elementos de las siguientes líneas del plan de estudios de creación digital de Raspberry Pi (htt

ps://rpf.io/curriculum) :

Utilice construcciones de programación básicas para crear programas simples (https://www.raspberrypi.or

g/curriculum/programming/creator)

Información adicional para educadores

https://projects.raspberrypi.org/en/projects/about-me/print 1/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Si necesita imprimir este proyecto, utilice la versión (https://projects.raspberrypi.org/en/projects/about-me/prin

t) para imprimir .

Use the link in the footer to access the GitHub repository for this project, which contains all resources (including an

example nished project) in the ‘en/resources’ folder.

https://projects.raspberrypi.org/en/projects/about-me/print 2/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 2 What you will need

Hardware

A computer capable of accessing the trinket.io (https://trinket.io) website

Software

This project can be completed in a web browser using trinket.io (https://trinket.io)

https://projects.raspberrypi.org/en/projects/about-me/print 3/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 3 Saying hello

Let’s start by writing some text.

Open the blank Python template trinket: jumpto.cc/python-new (http://jumpto.cc/python-new).

Type the following into the window that appears:

The line #!/bin/python3 just tells Trinket that we’re using Python 3 (the latest version).

Click Run, and you should see that the print() command prints everything between the quote marks ''.

If you’ve made a mistake, you’ll get an error message telling you what went wrong instead!

Try it! Delete the end quote ' or the closing bracket ) (or both) and see what happens.

Add the quote or bracket back in, and click Run to make sure your project works again.

You don’t need a Trinket account to save your projects!

If you don’t have a Trinket account, click the down arrow and then click Link. This will give you a link that you can save

and come back to later. You’ll need to do this every time you make changes, as the link will change!

https://projects.raspberrypi.org/en/projects/about-me/print 4/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

If you have a Trinket account, you can click Remix to save your own copy of the trinket.

https://projects.raspberrypi.org/en/projects/about-me/print 5/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 4 Challenge: What’s on your mind?

Change the code you just wrote to print something more interesting about you!

https://projects.raspberrypi.org/en/projects/about-me/print 6/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 5 ASCII art

Let’s print something much more fun than text: ASCII art! ASCII art (pronounced ‘ ask-e’) is creating pictures out of

text.

Let’s add some art to your program — a picture of a dog!

The dog’s legs are made using the pipe character | which you can type by pressing Shift + \ on most UK/US English

keyboards.

If you click Run, you’ll see that there’s a bug in your new code.

That’s because your text contains an apostrophe ', which Python thinks is the end of the text!

To x this, just put a backslash \ before the apostrophe in the word here's. This tells Python that the apostrophe
is part of the text.

If you prefer, you can use three apostrophes ''' instead of one, which allows you to print multiple lines of text
with one print statement:

https://projects.raspberrypi.org/en/projects/about-me/print 7/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 6 Challenge: about yourself

Write a Python program to tell others about yourself using text and ASCII art. You can create images of your hobbies,

friends, or anything you like!

Remember that the code you write in Trinket is public. Don’t share any personal information like your full name

or address!

Here’s an example:

https://projects.raspberrypi.org/en/projects/about-me/print 8/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 7 The year 2025

You can also do calculations and print numbers. Let’s nd out how old you’ll be in the year 2025!

To calculate how old you’ll be in the year 2025, you need to subtract the year you were born from 2025.

Add this code to your program:

Notice that you don’t need to put quotes around numbers. (You’ll need to change the number 2006 if you were
born in a di erent year.)

Click Run, and your program should print your age in the year 2025.

You could improve your program by using input() to ask the user their age and store it in a variable called born.

Run your program and then enter the year you were born. Did you get another error message?

That’s because anything typed into your program is text, and it needs to be converted to a number.

You can use int() to convert the text to an integer. An integer is a whole number.

You can also create another variable to store your calculation, and print that instead.

https://projects.raspberrypi.org/en/projects/about-me/print 9/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Finally, you can make your program easier to understand by adding a helpful message.

https://projects.raspberrypi.org/en/projects/about-me/print 10/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 8 Challenge: your age in dog years

Write a program to ask the user their age, and then tell them their age in dog years! You can calculate a person’s age in

dog years by multiplying their age by 7.

In programming, the symbol for multiplication is the * character, which you can usually type by pressing Shift + 8 on
the keyboard.

https://projects.raspberrypi.org/en/projects/about-me/print 11/12
18/1/2021 Sobre mi | Proyectos Raspberry Pi

Step 9 Challenge: calculating text

Did you know that you can also calculate text?!

What will the following program print to the screen? See if you can guess it correctly before running the program.

Can you make up any words of your own? You could even make your own patterns!

Published by Raspberry Pi Foundation (https://www.raspberrypi.org) under a Creative Commons license (ht

tps://creativecommons.org/licenses/by-sa/4.0/).

View project & license on GitHub (https://github.com/RaspberryPiLearning/about-me)

https://projects.raspberrypi.org/en/projects/about-me/print 12/12

You might also like