100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
BEST python practicals-solution-2019-20-class-xii $7.49   Add to cart

Interview

BEST python practicals-solution-2019-20-class-xii

 4 views  0 purchase
  • Course
  • Institution

Interview of 58 pages for the course Popular App Inventor_ Create Your Own Android Apps - pages 385 at (Exam Notes)

Preview 4 out of 58  pages

  • January 1, 2022
  • 58
  • 2021/2022
  • Interview
  • Unknown
  • Unknown
  • Secondary school
  • 2
avatar-seller
https://pythonschoolkvs.wordpress.com/
CLASS-XII
SUBJECT – COMPUTER SCIENCE (083)
PRACTICAL FILE SOLUTION
PRACTICAL
NO. OBJECTIVE & SOLUTION
1. Write a program in python to check a number whether it is prime or not.
num=int(input("Enter the number: "))
for i in range(2,num):
if num%i==0:
SOURCE print(num, "is not prime number")
CODE: break;
else:
print(num,"is prime number")


OUTPUT:

2. Write a program to check a number whether it is palindrome or not.
num=int(input("Enter a number : "))
SOURCE
CODE: n=num
res=0

, while num>0:
rem=num%10
res=rem+res*10
num=num//10
if res==n:
print("Number is Palindrome")
else:
print("Number is not Palindrome")


OUTPUT:

3. Write a program to calculate compound interest.
p=float(input("Enter the principal amount : "))
r=float(input("Enter the rate of interest : "))
t=float(input("Enter the time in years : "))
SOURCE
CODE: x=(1+r/100)**t

CI= p*x-p
print("Compound interest is : ", round(CI,2))

,OUTPUT:



4. Write a program to display ASCII code of a character and vice versa.
var=True
while var:
choice=int(input("Press-1 to find the ordinal value of a character \nPress-2 to
find a character of a value\n"))
if choice==1:
ch=input("Enter a character : ")
print(ord(ch))
elif choice==2:
SOURCE val=int(input("Enter an integer value: "))
CODE: print(chr(val))
else:
print("You entered wrong choice")

print("Do you want to continue? Y/N")
option=input()
if option=='y' or option=='Y':
var=True
else:

, var=False
Press-1 to find the ordinal value of a character
Press-2 to find a character of a value
1
Enter a character : a
97
Do you want to continue? Y/N
OUTPUT: Y
Press-1 to find the ordinal value of a character
Press-2 to find a character of a value
2
Enter an integer value: 65
A
Do you want to continue? Y/N
Write a program to input a character and to print whether a given character is an
5.
alphabet, digit or any other character.
ch=input("Enter a character: ")
if ch.isalpha():
print(ch, "is an alphabet")
SOURCE
CODE: elif ch.isdigit():
print(ch, "is a digit")
elif ch.isalnum():
print(ch, "is alphabet and numeric")

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller waseemmirza2262. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

70055 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.49
  • (0)
  Add to cart