0% found this document useful (0 votes)
1 views1 page

Python Practice Tasks

The document outlines a series of Python practice tasks focused on syntax fundamentals, string indexing, math functions, and error handling. It includes tasks for creating variables, using f-strings, defining functions with and without parameters, and implementing exception handling. Additionally, it encourages mixed practice through mini projects such as a student profile and a simple calculator.
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)
1 views1 page

Python Practice Tasks

The document outlines a series of Python practice tasks focused on syntax fundamentals, string indexing, math functions, and error handling. It includes tasks for creating variables, using f-strings, defining functions with and without parameters, and implementing exception handling. Additionally, it encourages mixed practice through mini projects such as a student profile and a simple calculator.
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

Python Practice Tasks | Syntax Fundamentals | Math & Parameters | |

------ | ------ | | 1. Variables and f-Strings


Task 1Create three variables:Your nameYour ageYour cityDisplay them using an f-string.
Task 2Store:Friend 1 nameFriend 2 nameFriend 3 namePrint all names in a single sentence
using an f-string.
Task 3Create variables for:Product NamePriceQuantityDisplay the bill details using an
f-string.
2. String IndexingTask 4Store your name in a variable and print:First characterLast
character
Task 5Store your college name and print:Second characterFourth characterLast character
Task 6Store your city name and print every character using indexing. | 3. Math
FunctionsTask 7Import the math module and find:Square root of 144Square root of 625
Task 8Round the following numbers:[Link]
Task 9Find:Ceiling value of 8.2Floor value of 8.9
4. Functions with ParametersTask 10Create a function called Addition(a,b) and
add:5,1020,30100,200
Task 11Create a function called Multiplication(a,b).Call it three times.
Task 12Create a function called Division(a,b).Call it with different values. | | Logic & Error
Handling | Mixed Practice | | ------ | ------ | | 5. Functions Without ParametersTask 13Create
a function that prints:Welcome to Python
Task 14Create a function that prints your:NameAgeCity
Task 15Create a function that prints numbers from 1 to 10.
6. Exception HandlingTask 16Create a variable and print it inside a try block.
Task 17Try printing a variable that does not [Link] the error using except.
Task 18Use:tryexceptfinallyPrint:"Program Started"Error message"Program Finished"
Task 19Take two numbers and divide [Link] division by zero using exception
handling. | 7. Mixed PracticeTask 20Create a mini student profile:NameAgeCourseDisplay
using f-string.
Task 21Create a function that accepts a student's marks and prints the result.
Task 22Create a program that:Stores your namePrints first and last characterUses a function
to display the nameUses try-except for error handling
Task 23Create a friend details program using:Variablesf-stringsFunctions
Task 24Create a simple calculator with:AdditionSubtractionMultiplicationDivision |

You might also like