0% found this document useful (0 votes)
43 views1 page

XI WKSHTR Computer Fundamentals

1. The document discusses Python fundamentals like variable names, operators, data types, functions etc. 2. It provides examples of valid and invalid variable names in Python and code snippets to find the output of arithmetic expressions. 3. The document also contains questions about comments in Python, different types of tokens, and examples of writing Python scripts to calculate simple interest, convert Celsius to Fahrenheit, and find a student's aggregate percentage.

Uploaded by

Anshuman Thakur
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)
43 views1 page

XI WKSHTR Computer Fundamentals

1. The document discusses Python fundamentals like variable names, operators, data types, functions etc. 2. It provides examples of valid and invalid variable names in Python and code snippets to find the output of arithmetic expressions. 3. The document also contains questions about comments in Python, different types of tokens, and examples of writing Python scripts to calculate simple interest, convert Celsius to Fahrenheit, and find a student's aggregate percentage.

Uploaded by

Anshuman Thakur
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/ 1

APEEJAY SCHOOL PANCHSHEEL PARK

SUBJECT: COMPUTER SC. CLASS : XI


CHAPTER : Python Fundamentals

1. What is the extension of a Python script file?


2. What is the shortcut key to execute current Python code?
3. What is a variable? What are the rules for forming valid variable names in Python?
4. Identify invalid variable names from the following, give reason for each:
Group, if, int, total marks, S.I., volume, tot_strength, 9t, tag$
5. Find the output of each of the following code segments:
(a) x=3 (b) x=-2 (c) a=5
y=x+2 y=2 b=2*a
x+=y x+=y a+=a+b
print(x,y) y-=x b*=a+b
print(x,y) print(a,b)

6. Write Python expressions equivalent to the following arithmetic/algebraic expressions:

a. a+b
-----
2
b. 32 + 93
--------
2
c. 32 + 93
------
5
d. √𝑎 + 𝑎+2
--------
𝑏
(u ,a, B are variables)
7. Write Python expressions to represent the following:
- Find the integral part of the quotient when 63 is divided by 29.
- Find the remainder when 63 is divided by 29.
- Find the fourth root of 3
- Find the square root of the sum of 8 and 43.
8. Find error(s), if any, in each of the following function calls:
(i) input(Enter a number: ) (ii) input("Enter your age: ") (iii) int(56)
(iv) int("56.6") (v) int("fifty6")
9. Find output of each of the following statements:
(i) print(int(56)) (ii) print(int("56")) (iii) print(int(5/4))
(iv) print(float(12.3)) (v) print(float("-12.45"))
10. What are comments in a program? How are comments given in a Python script? Give an
example.
11. What is a token? What are different categories of tokens in Python? Give two examples
of tokens of each category.
12. Write Python script to input the values of Principal, Rate, and Time and calculate Simple
Interest and Compound Interest. The script should also display the values of simple interest and
compound interest.
13. Write Python script to enter temperature in degree Celsius and display it into Fahrenheit. The
formula to convert from degree Celsius to degree Fahrenheit is:
14. A school conducts two weekly tests of 30 marks each, and a term exam of 100 marks. To
calculate the aggregate percentage (rounded up to 2 digits after decimal) of marks obtained
by a student, calculations are done as follow:
(weekly test total)/3 + 80% of term exam.
Write Python script to input weekly test marks and term exam marks, and calculate aggregate
percentage of a student. The script should then display weekly test marks, term exam marks,
and aggregate marks.

You might also like