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

Assignment 2 - Python Programming (1)

Uploaded by

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

Assignment 2 - Python Programming (1)

Uploaded by

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

Python Assignment-2

Conditional

1. Write a Python program that checks if a string is a palindrome, ignoring


spaces, punctuation, and case sensitivity.

2. Write a Python program to find the second largest number in a list.


3.Write a Python program to check whether a number is divisible by both 3
and 5.

4.Python program to check if a given year is a leap year or not.

5. Write a Python program that checks whether a number entered by the user
is positive, negative, or zero.
Loops
1.complete all example program given in ppt for loops

Solution: Paste code and screenshot of output

2.Write a program using range and for loop to print prime numbers between
2 and 100.
3.Write a program to compute the factorial of a number given by the user.
Use condition statements and looping construct only.

3. Write a program to take input from the user and print the Fibonacci Series
using a while loop for the given number of elements.

You might also like