Two built-in functions in Python are used to perform input and output operations (OI Operations). The two built-in functions for performing output and input operations are listed below. print() – This function is used to output data. input() – This function is used to perform input operations. Take Input from the User: To perform input […]
November 20, 2022 | python | No comments
What exactly is a Python Module? Python modules are files that contain Python definitions and statements. Functions, classes, and variables can all be defined by a module. A module may also contain executable code. Grouping related code into modules makes it easier to understand and use the code. It also helps to organize the code […]
November 18, 2022 | python | No comments
The Fibonacci Series generates the next number by adding two preceding numbers. The Fibonacci sequence begins with two numbers, F0 and F1. F0 and F1 can have initial values of 0 and 1, respectively. For instance, Program Code: Output: Note: also read about Convert Decimal to Binary Follow Me Please follow me to read my latest […]
November 18, 2022 | C++ | No comments
Given a decimal number as input, we need to write a program to convert the given decimal number into an equivalent binary number. Examples: Algorithm for Converting Decimal to Binary: Step 1: Divide the number by 2 and store the remainder in an array (modulus operator). Step 2: Divide the number by 2 using the […]
November 17, 2022 | C++ | No comments
Find the grade of the student based on the marks obtained in five subjects. Let the grade be calculated based on the following pattern: Average Mark Range Grade 91-100 A1 81-90 A2 71-80 B1 61-70 B2 51-60 C1 41-50 C2 33-40 D 21-32 E1 0-20 E2 To calculate a student’s grade based on total marks […]
November 17, 2022 | C++ | No comments
A variable is a name that refers to a memory location. A Python variable, also known as an identifier, is used to store data. Python is not a “statically typed” language. We do not need to declare variables or their types before using them. When we first assign a value to a variable, it is […]
November 16, 2022 | python | No comments
What are Python operators? Python operators are used to perform operations on values and variables in general. These are standard symbols used in logical and arithmetic operations. In this article, we will look at various Python operators. Note: OPERAND is the value on which the operator is applied. Types of Operators: Python language supports the […]
November 15, 2022 | python | No comments
Python allows us to perform a variety of mathematical operations with ease by importing a module called “math,” which is used to access mathematical functions. These methods are only applicable to integer or real-type objects, not complex numbers. Types of pre-defined functions: Python has two kinds of pre-defined functions. Inbuilt functions: These are functions that […]
November 13, 2022 | python | No comments
Mathematical Operators: Mathematical Operators are used in mathematics to perform operations such as addition, subtraction, multiplication, and division. Python has seven arithmetic operators: Addition Subtraction Multiplication Division Modulus Exponentiation Floor division Addition: The addition operator in Python is +. It is used to combine two values. Example: Output: Subtraction: The subtraction operator in Python is […]
November 13, 2022 | python | No comments
Python Syntax Rules: Here are a few things you should know beforehand: Python is case-sensitive, which means, for example, Name and name have different meanings The standard is to use English names in programming All variables should start with a lowercase letter, for example, var = 4 Functions begin with lowercase Classes begin with a capital letter There is no command […]
November 12, 2022 | python | No comments