Skip to content
CramShare
PremiumPractice exam

WGU D522: python for It Automation Study Tips 2024/2025;(100% Guaranteed success

D522 D 522 · Western Governors University

Updated today

Computer Science exam material, 36 pages. Originally published on StudyMerit.

Pages
36
Academic year
2025/2026
Language
English

What’s included

Preview 3 of 36 pages

See the first 3 pages exactly as they appear in the document.

Read page 1 as text

Python mid 1 answers Module - 1 1) Describe about different features of python programming language. Explain the applications of Python. Python is a dynamic, high level, free open source and interpreted programming language. It supports object - oriented programming as well as procedural oriented programming. In Python, we don’t need to declare the type of variable because it is a dynamically typed language. For example, x = 10 Here, x can be anything such as String, int, etc. Features in Python There are many features in Python, some of which are discussed below – 1. Easy to code: Python is a high - level programming language. Python is very easy to learn the language as compared to other languages like C, C#, Javascript, Java, e tc. It is very easy to code in python language and anybody can learn python basics in a few hours or days. It is also a developer - friendly language. 2. Free and Open Source: Python language is freely available at the official website and you can download i t from the given download link below click on the Download Python keyword. Download Python Since it is open - source, this means that source code is also available to the public. So you can download it as, us e it as well as share it. 3. Object - Oriented Language: One of the key features of python is Object - Oriented programming. Python supports object - oriented language and concepts of classes, objects encapsulation, etc. 4. GUI Programming Support: Graphical User interfaces can be made using a module such as PyQt5, PyQt4, wxPython, or Tk in python. PyQt5 is the most popular option for creating graphical apps with Python.

Read page 2 as text

5. High - Level Language: Python is a high - level language. When we write programs in python, we do not need to remember the system architecture, nor do we need to manage the memory. 6. Extensible feature: Python is a Extensible language. We can write us some Python code into C or C++ language and also we can compile that code in C/C++ l anguage. 7. Python is Portable language: Python language is also a portable language. For example, if we have python code for windows and if we want to run this code on other platforms such as Linux, Unix, and Mac then we do not need to change it, we can run this code on any platform. 8. Python is Integrated language: Python is also an Integrated language because we can easily integrated python with other languages like c, c++, etc. 9. Interpreted Language: Python is an Interpreted Language because Pyt hon code is executed line by line at a time. like other languages C, C++, Java, etc. there is no need to compile python code this makes it easier to debug our code. The source code of python is converted into an immediate form called bytecode . 10. Large St andard Library Python has a large standard library which provides a rich set of module and functions so you do not have to write your own code for every single thing. There are many libraries present in python for such as regular expressions, unit - testing, web browsers, etc. 11. Dynamically Typed Language: Python is a dynamically - typed language. That means the type (for example - int, double, long, etc.) for a variable is decided at run time not in advance because of this feature we don’t need to specify the type of variable. 2) Demonstrate a python program to read student details and print. Write a python program to read two numbers & print sum of those numbers. i) #student information name = input("Enter your name:") roll = input("Enter your roll number:") age = input("Enter your age:") branch = input("Enter your branch:") section = input("Enter your section:")

Read page 3 as text

print("Name of the student is:") print(name) print("Rollnumber of student is:") print(roll) print("Age of student is:") print(age) print("B ranch of student is:") print(branch) print("Section of student is:") print(section) ii) #addition of 2 numbers num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) sum = num1+num2 print("The sum of 2 numbers is:") print(sum) 3)Explain different operators in python programming. Write a program to demonstrate arithmetic, relational operators. i) 1 Arithmetic operators: Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication and division. Operator Description Syntax + Addition: adds two operands x + y - Subtraction: subtracts two operands x - y

33 more pages after this

You’ve read 3 of 36. Unlock once and it stays in your library — and if the rest doesn’t match what you just read, you get a refund.

$10.00

Yours permanently