0% found this document useful (0 votes)
25 views2 pages

Python Practicals Important Questions.

A great combination of some questions with codes for your help.

Uploaded by

Abhijeet Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
25 views2 pages

Python Practicals Important Questions.

A great combination of some questions with codes for your help.

Uploaded by

Abhijeet Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 2

1-

# Online Python compiler (interpreter) to run Python online.

# Write Python 3 code in this online editor and run it.

OUTPUT-

File "<string>", line 11

else:

SyntaxError: invalid syntax

>

2-

# Online Python compiler (interpreter) to run Python online.

# Write Python 3 code in this online editor and run it.

p=float(input("Enter The Principal Amount:-"))

r=float(input("Enter The Rate Of Intrest:-"))

t=float(input("Enter The Time in Years:-"))

x=(1+r/100)**t

ci=p*x-p

print("compount Intrest is=",round(ci,2))

OUTPUT-

Enter The Principal Amount:-100

Enter The Rate Of Intrest:-2

Enter The Time in Years:-2

compount Intrest is= 4.04

>

# Online Python compiler (interpreter) to run Python online.


# Write Python 3 code in this online editor and run it.

n=int(input("Enter the Number:-"))

temp=n

rev=0

while(n>0):

dig=n%10

rev=rev*10+dig

n=n//10

if(temp==rev):

print("The Number is a Palindrome!")

else:

print("The Number isn't a Palindrome!")

OUTPUT-

WHEN IT IS NOT A PALINDROME WHEN IT IS PALINDROME

Enter the Number:-1211 Enter the Number:-121

The Number isn’t a Palindrome The Number is a Palindrome!

> >

You might also like