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

Practice Set 01

The document outlines a series of Python programming tasks for users to practice basic coding skills. Tasks include greeting a user, calculating sums, areas, conversions, simple interest, swapping values, checking even/odd, reversing strings, calculating squares and cubes, and concatenating strings. Each task is accompanied by an example input and output for clarity.

Uploaded by

s.saloni1213
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)
4 views3 pages

Practice Set 01

The document outlines a series of Python programming tasks for users to practice basic coding skills. Tasks include greeting a user, calculating sums, areas, conversions, simple interest, swapping values, checking even/odd, reversing strings, calculating squares and cubes, and concatenating strings. Each task is accompanied by an example input and output for clarity.

Uploaded by

s.saloni1213
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

1.

​ Greet the User​

○​ Write a Python program that asks the user for their name and prints a greeting
message.

Example:​
Input: Enter your name: Alice

​ ​ Output: Hello, Alice! Welcome!

○​
2.​ A sum of Two Numbers​

○​ Write a program that takes two numbers as input and prints their sum.

Example:​
Input: 5, 8

Output: Sum = 13

○​
3.​ Area of a Rectangle​

○​ Ask the user to enter the length and width of a rectangle and calculate its area.

Example:​
Input: Length = 10, Width = 5

Output: Area = 50

○​
4.​ Convert Celsius to Fahrenheit​

○​ Take temperature in Celsius from the user and convert it to Fahrenheit using the
formula:​
F=(C×9/5)+32F = (C \times 9/5) + 32

Example:​
Input: 0

Output: Fahrenheit = 32.0


5.​ Simple Interest Calculator​

○​ Take principal amount, rate of interest, and time (years) from the user and
calculate simple interest.
○​ Formula:​
SI=(P×R×T)/100SI = (P \times R \times T) / 100

Example:​
Input: P = 1000, R = 5, T = 2

Output: Simple Interest = 100

○​
6.​ Swap Two Numbers​

○​ Take two numbers as input and swap their values without using a third variable.

Example:​
Input: A = 5, B = 10

Output: A = 10, B = 5

○​
7.​ Check Even or Odd​

○​ Take an integer as input and determine whether it is even or odd.

Example:​
Input: 7

Output: 7 is an odd number.

○​
8.​ Reverse a String​

○​ Take a string as input and print its reverse.

Example:​
Input: Python

Output: nohtyP
9.​ Calculate the Square and Cube of a Number​

○​ Take a number as input and print its square and cube.

Example:​
Input: 4

Output: Square = 16, Cube = 64

○​
10.​Concatenate Two Strings​

●​ Take two strings as input and concatenate them.

Example:​
Input: "Hello", "World"

Output: "HelloWorld"

You might also like