0% found this document useful (0 votes)
2 views3 pages

Python Lista 1

The document outlines a series of programming tasks in Python, ranging from basic to more advanced concepts. Tasks include printing messages, working with variables, performing arithmetic operations, handling user input, and utilizing loops and functions. Additional tasks cover exception handling, building a basic calculator, and generating random numbers.

Uploaded by

deutschmt1234
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)
2 views3 pages

Python Lista 1

The document outlines a series of programming tasks in Python, ranging from basic to more advanced concepts. Tasks include printing messages, working with variables, performing arithmetic operations, handling user input, and utilizing loops and functions. Additional tasks cover exception handling, building a basic calculator, and generating random numbers.

Uploaded by

deutschmt1234
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/ 3

Task 1: Hello, World!

Write a Python program that prints "Hello, World!" to the console.

Task 2: Variables and Data Types

Create variables to store an integer, a float, a string, and a boolean. Print out the values and data

types of these variables.

Task 3: Arithmetic Operations

Write a program that performs basic arithmetic operations (addition, subtraction, multiplication, and

division) on two numbers entered by the user.

Task 4: User Input

Create a program that asks the user for their name and then prints a greeting using their name.

Task 5: Conditional Statements

Write a program that checks if a user-inputted number is even or odd and prints an appropriate

message.

Task 6: Loops

Use a loop to print the numbers from 1 to 10.

Task 7: Lists

Create a list of your favorite fruits. Print each fruit from the list using a loop.

Task 8: Functions

Write a function that calculates the area of a rectangle. The function should take the length and
width as parameters and return the area.

Task 9: String Manipulation

Ask the user for their favorite quote, then print it in uppercase and lowercase.

Task 10: Lists and Conditionals

Create a list of numbers. Write a program that finds and prints the largest number in the list.

Task 11: Dictionaries

Create a dictionary that maps the names of fruits to their colors. Allow the user to enter a fruit name

and print out its color.

Task 12: File Handling

Write a program that reads a text file and counts the number of words in it.
Additional Tasks for the Ambitious

Task 13: Exception Handling

Create a program that asks the user to enter a number. Handle any exceptions that may occur if the

user enters something that's not a number.

Task 14: Basic Calculator

Build a basic calculator that can perform addition, subtraction, multiplication, and division. Ask the

user for two numbers and an operation, then calculate and display the result.

Task 15: Random Number Generator

Generate a random number between 1 and 10 and ask the user to guess it. Provide feedback on

whether their guess was too high, too low, or correct.

You might also like