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

Python Tasks

some python tasks for practise

Uploaded by

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

Python Tasks

some python tasks for practise

Uploaded by

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

Python Tasks

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

2. Write a program that takes two numbers from the user and performs
addition, subtraction, multiplication, and division operations.

3. Write a function that checks whether a string is a palindrome (reads


the same forward and backward).

4. Write a program that prints the first 'n' numbers of the Fibonacci
sequence.

5. Write a function that takes a string input and counts the number of
vowels and consonants in it.

6. Write a program that checks if a number is prime or not.

7. Write a program where the computer randomly selects a number, and


the user has to guess it. The program should give hints if the guess is
too high or too low.

8. Write a function that takes a number and returns the sum of its digits.

9. Write a program that reads the contents of a text file, processes the
data (e.g., counting lines or words), and writes results to another file.

10. Create a command-line quiz program where users can answer


multiple-choice questions, and the program keeps track of the score.

Deadline : Monday 18th November 2024

You might also like