python_example

Write a program to print the first half values in one line and the last half values in one line.

Write a program to print the first half values in one line and the last half values in one line. b)  With a given tuple (1,2,3,4,5,6,7,8,9,10), write a program to print the first half values in one line and the last half values in one line. Aim: A given tuple (1,2,3,4,5,6,7,8,9,10), write a program to …

Write a program to print the first half values in one line and the last half values in one line. Read More »

Generate a list and tuple with comma-separated numbers

Generate a list and tuple with comma-separated numbers Python list: A list is a container that holds comma-separated values ​​(items or elements) between class brackets, where items or elements are not required to all have the same type. In general, we can define a list as an object that contains many data items (elements). The …

Generate a list and tuple with comma-separated numbers Read More »

Define a function which generates Fibonacci series up to n numbers

Define a function which generates Fibonacci series up to n numbers Note: Fibonacci numbers are numbers in integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,… .. In mathematical terms, a sequence of Fibonacci numbers is defined by the iteration relation. What is Fibonacci sequence and its formula? The first …

Define a function which generates Fibonacci series up to n numbers Read More »

Display all such numbers which are divisible by 7 but are not a multiple of 5 between 1000 and 2000

Display all such numbers which are divisible by 7 but are not a multiple of 5 between 1000 and 2000 Divisibility by 5Divisibility by 5 is easily determined by checking the last digit in the number (475), and seeing if it is either 0 or 5. If the last number is either 0 or 5, …

Display all such numbers which are divisible by 7 but are not a multiple of 5 between 1000 and 2000 Read More »

Takes three numbers as arguments and returns the largest of them

Takes three numbers as arguments and returns the largest of them. Use of min() and max() in Python  User can enter any three numbers from key-board and then we can find that among that three number which is greatest number. If you want find least number then also you can find. Aim: A function max_of_three() that takes …

Takes three numbers as arguments and returns the largest of them Read More »

perform various operations on string using string libraries in python

perform various operations on string using string libraries. In computer science, in the field of formal language theory, frequent use is made up of a variety of string functions; However, the notation used is different from that used for computer programming, and theoretically some commonly used functions are rarely used when programming. This article defines …

perform various operations on string using string libraries in python Read More »

print factorial of a number in python

print factorial of a number in python In combinatorics, the factorial number system, also known as factadic, is a mixed radix numeral system optimized for serial numbering. It is also called factorial base, although not acting as a factorial base, but as a place value of digits. By converting numbers less than n! For the …

print factorial of a number in python Read More »

write a program to determine whether a person is eligible for voting or not

write a program to determine whether a person is eligible for voting or not A) Implement the Python script to read the person’s age from the keyboard and see if it is eligible to vote. Purpose: to read a person’s age from the keyboard and to demonstrate whether he is eligible to vote. Case: Voting …

write a program to determine whether a person is eligible for voting or not Read More »

Flowchart to find largest element in an array in python

Flowchart to find largest element in an array in python Develop a flowchart to find largest element in an array. Aim: To  draw the flowchart for finding largest element in the array. Algorithm: Step1: Start Step2: Enter the array size and read as n. Step3: Enter the array elements and read as a[i]. Step4: Initialize …

Flowchart to find largest element in an array in python Read More »