12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 13/09/2022
QB365 provides a detailed and simple solution for every Possible Book Back Questions in Class 12 Computer Science Subject - Importing C++ Programs in Python , English Medium. It will help Students to get more practice questions, Students can Practice these question papers in addition to score best marks.
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
Write a Python program to execute the following c++ coding.
#include <iostream>
using namespace std;
int main()
{ cout<<“WELCOME”;
return(0);
}
The above C++ program is saved in a file welcome.cpp
2.
Write the syntax for getopt( ) and explain its arguments and return values.
3.
4.
Explain each word of the following command.
Python
5.
Write any 5 features of Python.
1.
Execution Steps:
//save above file as welcome.cpp
#Now select File -> New in Notepad and type the Python program
#save the file as fun.py
#Program that compiles and executes a .cpp file
#Python fun.py- iC: |pyprg| welcome - file.cpp
Program:
import sys, os, getopt
def main (argv):
cpp_file="
exe_file="
opts, args = getopt.getopt(argv, "i:", ['ifile='])
for o a in opts
if o in ("-i, "--ifile"):
cpp_file=a+ .'cpp'
exe_file = a+ 'exe'
run (cpp_file, exe_file)
def run (cpp_file, exe_file):
print("Compiling" + Cpp_file)
os.system ('g++' + cpp_file+'_o'+exe_file)
print("Running" + exe_file)
print("---------------")
print
Os.system(exe_file)
print
if_name_=='_main_':
main (sys.argv [1:])
Output:
welcome.
2.
getopt() method returns value consisting of two elements. Each of these values are stored separately in two different list opts and args. opts contains list of splitted strings like made, path and args contains any string if at all not splitted because of wrong path or mode. args will be an empty array if there is no error in splitting strings by getopt().
Example:
The Python code which is going to execute the C++ file p4 in command line will have the getopt() method.
Syntax:
opts, args = getopt.getopt (argv, "i:", ['ifile ='])
where opts contains ('-i','c:\\pyprg\\p4')]]
-i:- option nothing but mode should be followed by
'c:\\pyprg\\p4' value nothing but the absolute path of C++ file,
Since the entire command-line commands are parsed and no leftover arguments, the second argunent args will be empty[].
3.
4.
Python < filename.py > - < i > <C++ filename without cpp extension>
| Python | Keyword to execute the Python program from command-line |
| filename.py- i | Name of the Python program to executed input mode |
| C++ filename without cpp extension | Name of C++ file to be compiled and executed |
For example type Python pycpp.py - i pali in the command prompt and press enter key. If the compilation is successful we will get the desired output. Otherwise the error will be displayed.
5.
(i) Python uses Automatic Garbage Collection whereas C++ does not.
(ii) C++ is a statically typed language, while Python is a dynamically typed language.
(iii) Python runs through an interpreter, while C++ is pre-compiled.
(iv) Python code tends to be 5 to 10 times shorter than that written in C++.
(v) In Python, there is no need to declare types explicitly where as it should be done in C++.
(vi) In Python, a function may accept an argument of any type, and return multiple values without any kind of declaration beforehand. Whereas in C++ return statement can return only one value.
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards