Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Exercise 01 - PythonBasics

Uploaded by

Priyan Priyan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Exercise 01 - PythonBasics

Uploaded by

Priyan Priyan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Variables and Data Types

Exercise 1.1: Basic Data Types

• Task: Create variables of different data types (integer, float, string, boolean) and print their
types and values.

Exercise 1.2: Type Conversion

• Task: Convert between different data types and print the results.

Strings and String Operations


Exercise 2.1: String Manipulation

• Task: Perform various string operations such as concatenation, slicing, and formatting.

Exercise 2.2: Palindrome Checker

• Task: Write a function to check if a string is a palindrome.

Conditionals
Exercise 3.1: Simple Calculator

• Task: Write a program that takes two numbers and an operator (+, -, *, /) and performs the
corresponding calculation.

Exercise 3.2: Grading System

• Task: Create a grading system based on score ranges.

Loops
Exercise 4.1: Sum of Numbers

• Task: Calculate the sum of numbers from 1 to 10 using a for loop.

Exercise 4.2: Fibonacci Sequence

• Task: Generate the first 10 numbers of the Fibonacci sequence using a while loop

Functions
Exercise 5.1: Factorial Function

• Task: Write a function to calculate the factorial of a number.


Exercise 5.2: Maximum of Three Numbers

• Task: Write a function to find the maximum of three numbers.

Basic File Operations


Exercise 6.1: Writing to a File

• Task: Write a program to create a file and write some text to it.

Exercise 6.2: Reading from a File

• Task: Write a program to read and display the contents of a file.

You might also like