Algorithms format (1)-1
Algorithms format (1)-1
to celsius
Step 1: Start.
Step 2: Read F.
Step 3: C=(5(F-32))/9.
Step 4: Print C.
Step 5: Stop
Step 4: Initialize f = 0
Step 6: Display f
Step 7: Stop
Aim : Alogorithm to construct the following pattern using
nested loop: *
***
*****
*******
step1: Start
step3: [initialize]
r=1
num>=r
step5: [initialize]
c=1
step8: c=c+1
step10: r=r+1
step11: stop
Aim : Algorithm to Find Prime Number Program
Else,
Step 1: Start
Step 5: Stop
Factorial(n)
Step 2: Else
f=n*factorial(n-1)
Step 3: Return f
Aim : Algorithm to count the number of even and odd
numbers from an array of N numbers.
Step 1: Start
Else
Step 4: Exit
Aim : Algorithm to reverse a string word by word.
Step 1: Start
There are following three rules to be followed while solving tower of hanoi algorithm:
Utilize recursion to transfer disks from the source rod to the destination rod via a helper rod.
step 1: Move 'N-1' disks from the source rod(A) to the auxiliary rod(B), using the
destination rod (C) as the helper.
step 2: Move the last disk from the source rod(A) to the destination(C) rod directly.
step 3: Move the 'N-1' disks from the auxiliary rod(B) to the destination rod(C), using
the source rod(A) as the helper.
Aim : Algorithm for Guessing the Number game.
Step 3: The user’s guess is matched with the random number picked by
the computer.
Step 4: If the match is there, then you will get to see, “You got it right in
___ tries.”
Step 5: If the number is not matched, the computer tells you that the
number the user wrote is higher or lower than the number chosen by it.
Step 6: Looking at the scenario again, the user will make a guess and write
the number down.
Step 7: Steps 3-6 are repeated until 6 tries or the correct number is
guessed (whatever comes first).
Step 8: If you guess the correct number before 6 tries, you will get to see,
“You got it right in _____ tries.”
Step 9: If you didn’t get the number in 6 guesses, you will get “You did not
get the number in 6 guesses. My number was _____. “
Step 10: .In the end, it will ask you if you would like to Play again and then
display a thank you note.
Aim : Algorithm for Dictionary with words and their
meanings.
Step 1. Start.
message.
Step 6. Run the Tkinter main loop to keep the window open.
Step 7. End.
Aim : To write a Python program that accesses the
Facebook Messenger API and retrieves message data.
Step 1 : Start
Step 4 : Create a Facebook app and generate the access token with
appropriate permissions.
Step 7 : Stop
Aim : To write a Python program that utilizes the
Openweather API to get current weather information.
Step 1 : Start
http://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units
=metric
Step 6 : Create a response object using the get method of requests module.
Step 7 : If the response code is 200, print the weather information of the city using json
object.
Step 8 : Get the name of the city as input and call the function get_current_weather(city).
Step 9 : Stop
Aim : To write a Python program that uses a dataset
and analyzes the operations including filtering and
grouping using pandas module.
Step 1 : Start
Step 3 : Call the read_csv method to read the data from the dataset sales_data.csv.
Step 4 : Print the header data, summary statistics, filtering, grouping and sorted data using
Step 5 : Stop
Aim : To write a Python program to perform numerical
operations on arrays using numpy module.
Step 1 : Start
Step 4 : Print the arrays and the results of the basic operations – addition, subtraction,
Step 6 : Print the maximum element and the sum of elements in arr2.
Step 7 : Create another array arr3. Print the array arr3 and the reshaped array.
Step 8 : Stop
Aim : To write a Python program for data visualization
by creating meaningful plots from a dataset using
matplotlib and seaborn modules.
Step 1 : Start
Step 4 : Set the parameters for scatter, bar, box and histogram charts.
Step 6 : Stop