[PriP 1.1] Revision Tour-1 – Practical 1.1
Progress in Computer Science with Python by Sumita Arora for CBSE Class 12 is a practical book which as understood by name is recommended by teachers to enhance subject understanding of students and in some schools, given for holiday homework. In any case, its questions can be tricky and lengthy for some, in that case, PriP Sumita Arora class 12 solutions are given.
Table of Contents
PriP 1.1 – Python: Basic Input/Output Solutions
1. For each of the following, write a single (that is, one) Python statement:
- Tell the user to Enter your name, then read in, and assign to a variable, a string typed in by the user.
- Tell the user to Enter your age, then read in, and assign to a variable, an integer typed in by the user.
- Print out, on separate lines, Your name is name and Your age is age, where name and age are the values of the two variables entered above.
Solution:
# (a)
name = input("Enter your name: ")
# (b)
age = int(input("Enter your age: "))
# (c)
print("Your name is", name)
print("Your age is", age)