UC Berkeley School of Information - home

  • Certificate in Applied Data Science
  • What is Cybersecurity?
  • Careers in Cybersecurity
  • MICS Class Profile
  • Study Business Intelligence
  • What Is Data Analytics?
  • What Is Data Science?
  • Careers in Data Science
  • MIDS Class Profile
  • Study Applied Statistics
  • 5th Year MIDS
  • International Admissions
  • Fellowships
  • Student Profiles
  • Alumni Profiles
  • Video Library
  • Apply Now External link: open_in_new

Python Practice Problems for Beginner Coders

August 30, 2021 

Python Practice Problems for Beginner Coders

From sifting through Twitter data to making your own Minecraft modifications, Python is one of the most versatile programming languages at a coder’s disposal. The open-source, object-oriented language is also quickly becoming one of the most-used languages in data science. 

According to the Association for Computing Machinery, Python is now the most popular introductory language at universities in the United States.

To help readers practice the Python fundamentals, [email protected] gathered six coding problems, including some from the W200: Introduction to Data Science Programming course. The questions below cover concepts ranging from basic data types to object-oriented programming using classes.

Python, an open-source, object-oriented language, is one of the most versatile programming languages in data science.

Are You Ready to Start Your Python Practice?

Consider the following questions to make sure you have the proper prior knowledge and coding environment to continue.

How much Python do I need to already know?

This problem set is intended for people who already have familiarity with Python (or another language) and data types. Each problem highlights a few different skills, and they gradually become more complicated. To learn more about the different fundamentals tested here, use the Resources section accompanying each question.

Readers who want to learn more about Python before beginning can access the following tools:

Where do I write my code?

[email protected] created a Google Colab notebook as a starting point for readers to execute their code. Google Colab is a free computational environment that allows anyone with an Internet connection to execute Python code via the browser.

For a more thorough introduction to Google’s Colab notebooks and how to use them, check out this guide to Getting Started with Google Colab from Towards Data Science.

You can also execute code using other systems, such as a text editor on your local machine or a Jupyter notebook.

My answers don’t look the same as the provided solutions. Is my code wrong?

The solutions provided are examples of working code to solve the presented problem. However, just like multiple responses to the same essay prompt will look different, every solution to a coding problem can be unique.

As you develop your own coding style, you may prefer different approaches. Instead of worrying about matching the example code exactly, focus on making sure your code is accurate, concise, and clear.

I’m ready, let’s go!

Below are links to the Google Colab notebooks created by [email protected] that you can use to create and test your code.

Python Practice Problems: QUESTIONS

This notebook contains the questions and space to create and test your code. To use it, save a copy to your local drive.

Python Practice Problems: SOLUTIONS

This notebook contains the questions and corresponding solutions.

Python Exercises

1. fly swatting: debugging and string formatting exercise.

The following code chunk contains errors that prevent it from executing properly. Find the “bugs” and correct them.

def problem_one():

for state, city in capitals.items() print(f”The capital of {state) is {‘city’}.”

Once fixed, it should return the following output:

The capital of Maryland is Annapolis. The capital of California is Sacramento. The capital of New York is Albany. The capital of Utah is Salt Lake City. The capital of Alabama is Montgomery.

Python Debugging and String Formatting Resources

2. That’s a Wrap: Functions and Wrapped Functions Exercise

Write a function multiply() that takes one parameter, an integer x . Check that x is an integer at least three characters long. If it is not, end the function and print a statement explaining why. If it is, return the product of x ’s digits.

Write another function matching() that takes an integer x as a parameter and “wraps” your multiply() function. Compare the results of the multiply() function on x with the original x parameter and return a sorted list of any shared digits between the two. If there are none, print “No shared digits!”

Your code should reproduce the following examples:

>multiply(1468) 192

>multiply(74) This integer is not long enough!

>matching(2789475) [2,4]

Python Functions Resources

3. Show Me the Money: Data Types and Arithmetic Exercise

Write code that asks a user to input a monetary value (USD). You can assume the user will input an integer or float with no special characters. Return a print statement using string formatting that states the value converted to Euros (EUR), Japanese Yen (JPY), and Mexican Pesos (MXN). Your new values should be rounded to the nearest hundredth.

>Input a value to convert from $USD: 189 189 USD = 160.65 EUR = 20,909.07 JPY = 3,783.78 MXN

>Input a value to convert from $USD: 17.82 17.82 USD = 15.15 EUR = 1,971.43 JPY = 356.76 MXN

Hint: To match the exact values from the example, you can use currency conversion ratios from the time of publication. As of July 6, 2021, $1 USD is equivalent to 0.85 EUR, 110.63 JPY, and 20.02 MXN.

Python Data Types and Arithmetic Resources:

4. What’s in a Name: String Slicing and If/Else Statements Exercise

Write a script that prompts the user for a name (assume it will be a one-word string). Change the string to lowercase and print it out in reverse, with only the first letter of the reversed word in uppercase. If the name is the same forward as it is backward, add an additional print statement on the next line that says “Palindrome!”

>Enter your name: Paul Luap

>Enter your name: ANA Ana Palindrome!

Hint: Use s.lower() and s.upper() , as appropriate.

Python String and If/Else Statement Resources:

5. Adventures in Loops: “For” Loops and List Comprehensions Exercise

Save the paragraph below — from Alice’s Adventures in Wonderland — to a variable named text . Write two programs using “for” loops and/or list comprehensions to do the following: 

text = “Alice was beginning to get very tired of sitting \ by her sister on the bank, and of having nothing to do: \ once or twice she had peeped into the book her sister \ was reading, but it had no pictures or conversations in \ it, ‘and what is the use of a book,’ thought Alice, \ ‘without pictures or conversations?’”

Python “for” Loop and List Comprehensions Resources:

6. The Drones You’re Looking For: Classes and Objects

Make a class named Drone that meets the following requirements:

Your code should mimic this sample output:

> d1 = Drone(100) > d1.fly() The drone is flying at 100 feet.

> d1.altitude = 300 > d1.fly() The drone is flying at 300 feet.

> d1.ascend(100) > d1.fly() The drone is flying at 400 feet.

> d1.ascend_count 1

Python Classes and Objects Resources:

7. Top of the Class: Dictionaries and “While” Loops Exercise

Write a program that lets the user create and manage a gradebook for their students. Create a Gradebook class that begins with an empty dictionary. Use helper functions inside the class to run specific tasks at the user’s request. Use the input() method to ask users what task they would like to complete. The program should continue to prompt the user for tasks until the user decides to quit. Your program must allow the user to do the following:

Your code should reproduce the following example:

>What would you like to do?: Add student >Enter student name: Natalie A new student! Adding them to the gradebook... >Enter student grade(s): 87,82 New entry complete!

>What would you like to do?: View gradebook {'natalie': [87.0, 82.0]}

>What would you like to do?: Calculate averages natalie: 84.50

>What would you like to do?: Quit End of program

Hint: Use a “while” loop to run the program while the input() response is anything other than “quit.” Within the “while” loop, set up if/else statements to manage each potential response.

Python Dictionaries and “While” Loop Resources:

Additional Python Coding Exercises

Looking for more Python practice? Here are some additional problem sets to work on fundamental coding skills:

Advent of Code This site hosts a yearly advent calendar every December, with coding challenges that open daily at midnight PST. Coders can build their own small group competitions or compete in the overall one. Past years’ problems are available for non-competitive coding.

Eda Bit Thousands of Python challenges that use an interactive interface to run and check code against the solutions. Users can level up and sort by difficulty.

PracticePython.org These 36 exercises test users’ knowledge of concepts ranging from input() to data visualization.

Python exercises, w3resource A collection of hundreds of Python exercises organized by concept and module. This set also includes a section of Pandas data exercises.

Created by [email protected], the online Master of Information and Data Science from UC Berkeley

Request More Information

Say "Hello, World!" With Python Easy Max Score: 5 Success Rate: 96.81%

Python if-else easy python (basic) max score: 10 success rate: 90.48%, arithmetic operators easy python (basic) max score: 10 success rate: 97.74%, python: division easy python (basic) max score: 10 success rate: 98.75%, loops easy python (basic) max score: 10 success rate: 98.34%, write a function medium python (basic) max score: 10 success rate: 90.50%, print function easy python (basic) max score: 20 success rate: 97.21%, list comprehensions easy python (basic) max score: 10 success rate: 97.96%, find the runner-up score easy python (basic) max score: 10 success rate: 94.08%, nested lists easy python (basic) max score: 10 success rate: 91.53%.

Python Programming

Practice Python Exercises and Challenges with Solutions

Free Coding Exercises for Python Developers. Exercises cover Python Basics , Data structure , to Data analytics . As of now, this page contains 18 Exercises.

What included in these Python Exercises?

Each exercise contains specific Python topic questions you need to practice and solve. These free exercises are nothing but Python assignments for the practice where you need to solve different programs and challenges.

These Python programming exercises are suitable for all Python developers. If you are a beginner, you will have a better understanding of Python after solving these exercises. Below is the list of exercises.

Select the exercise you want to solve .

Basic Exercise for Beginners

Practice and Quickly learn Python’s necessary skills by solving simple questions and problems.

Topics : Variables, Operators, Loops, String, Numbers, List

Python Input and Output Exercise

Solve input and output operations in Python. Also, we practice file handling.

Topics : print() and input() , File I/O

Python Loop Exercise

This Python loop exercise aims to help developers to practice branching and Looping techniques in Python.

Topics : If-else statements, loop, and while loop.

Python Functions Exercise

Practice how to create a function, nested functions, and use the function arguments effectively in Python by solving different questions.

Topics : Functions arguments, built-in functions.

Python String Exercise

Solve Python String exercise to learn and practice String operations and manipulations.

Python Data Structure Exercise

Practice widely used Python types such as List, Set, Dictionary, and Tuple operations in Python

Python List Exercise

This Python list exercise aims to help Python developers to learn and practice list operations.

Python Dictionary Exercise

This Python dictionary exercise aims to help Python developers to learn and practice dictionary operations.

Python Set Exercise

This exercise aims to help Python developers to learn and practice set operations.

Python Tuple Exercise

This exercise aims to help Python developers to learn and practice tuple operations.

Python Date and Time Exercise

This exercise aims to help Python developers to learn and practice DateTime and timestamp questions and problems.

Topics : Date, time, DateTime, Calendar.

Python OOP Exercise

This Python Object-oriented programming (OOP) exercise aims to help Python developers to learn and practice OOP concepts.

Topics : Object, Classes, Inheritance

Python JSON Exercise

Practice and Learn JSON creation, manipulation, Encoding, Decoding, and parsing using Python

Python NumPy Exercise

Practice NumPy questions such as Array manipulations, numeric ranges, Slicing, indexing, Searching, Sorting, and splitting, and more.

Python Pandas Exercise

Practice Data Analysis using Python Pandas. Practice Data-frame, Data selection, group-by, Series, sorting, searching, and statistics.

Python Matplotlib Exercise

Practice Data visualization using Python Matplotlib. Line plot, Style properties, multi-line plot, scatter plot, bar chart, histogram, Pie chart, Subplot, stack plot.

Random Data Generation Exercise

Practice and Learn the various techniques to generate random data in Python.

Topics : random module, secrets module, UUID module

Python Database Exercise

Practice Python database programming skills by solving the questions step by step.

Use any of the MySQL, PostgreSQL, SQLite to solve the exercise

Exercises for Intermediate developers

The following practice questions are for intermediate Python developers.

If you have not solved the above exercises, please complete them to understand and practice each topic in detail. After that, you can solve the below questions quickly.

Exercise 1: Reverse each word of a string

Expected Output

Steps to solve this question :

Exercise 2: Read text file into a variable and replace all newlines with space

Given : Assume you have a following text file (sample.txt).

Expected Output :

Steps to solve this question : -

Exercise 3: Remove items from a list while iterating

Description :

In this question, You need to remove items from a list while iterating but without creating a different copy of a list.

Remove numbers greater than 50

Expected Output : -

Solution 1: Using while loop

Solution 2: Using for loop and range()

Exercise 4: Reverse Dictionary mapping

Exercise 5: display all duplicate items from a list.

Solution 1 : - Using collections.Counter()

Solution 2 : -

Exercise 6: Filter dictionary to contain keys present in the given list

Exercise 7: print the following number pattern.

Refer to Print patterns in Python to solve this question.

Exercise 8: Create an inner function

Question description : -

Exercise 9: Modify the element of a nested list inside the following list

Change the element 35 to 3500

Exercise 10: Access the nested key increment from the following dictionary

Under Exercises: -

Python Object-Oriented Programming (OOP) Exercise: Classes and Objects Exercises

Updated on:  December 8, 2021 | 47 Comments

Python Date and Time Exercise with Solutions

Updated on:  December 8, 2021 | 9 Comments

Python Dictionary Exercise with Solutions

Updated on:  August 23, 2022 | 49 Comments

Python Tuple Exercise with Solutions

Updated on:  December 8, 2021 | 71 Comments

Python Set Exercise with Solutions

Updated on:  October 20, 2022 | 24 Comments

Python if else, for loop, and range() Exercises with Solutions

Updated on:  September 6, 2021 | 246 Comments

Updated on:  August 2, 2022 | 117 Comments

Updated on:  September 6, 2021 | 85 Comments

Python List Exercise with Solutions

Updated on:  December 8, 2021 | 167 Comments

Updated on:  December 8, 2021 | 6 Comments

Python Data Structure Exercise for Beginners

Updated on:  December 8, 2021 | 105 Comments

Python String Exercise with Solutions

Updated on:  October 6, 2021 | 189 Comments

Updated on:  March 9, 2021 | 22 Comments

Updated on:  March 9, 2021 | 45 Comments

Updated on:  July 20, 2021 | 27 Comments

Python Basic Exercise for Beginners

Updated on:  September 26, 2022 | 413 Comments

Useful Python Tips and Tricks Every Programmer Should Know

Updated on:  May 17, 2021 | 20 Comments

Python random Data generation Exercise

Updated on:  December 8, 2021 | 13 Comments

Python Database Programming Exercise

Updated on:  March 9, 2021 | 15 Comments

Updated on:  June 1, 2022 |

About PYnative

PYnative.com is for Python lovers. Here, You can get Tutorials, Exercises, and Quizzes to practice and improve your Python skills .

Explore Python

To get New Python Tutorials, Exercises, and Quizzes

Legal Stuff

We use cookies to improve your experience. While using PYnative, you agree to have read and accepted our Terms Of Use , Cookie Policy , and Privacy Policy .

Copyright © 2018–2023 pynative.com

problem solving and python programming important questions

Towards Data Science

Luay Matalka

Jan 22, 2021

Member-only

Best Way to Solve Python Coding Questions

Learn how to effectively tackle python coding questions.

There is certainly some controversy regarding the benefits of Python coding websites such as codewars or leetcode, and whether or not using them actually makes us better programmers. Despite that, many people still use them to prepare for Python interview questions, keeping their Python programming skills sharp, and/or just for fun. Nevertheless, there’s definitely a place for these resources for any Python programmer or data scientist.

In this tutorial, we’ll look at the best way to extract the most utility out of these python coding problems. We will look at a fairly simple Python coding question and work through the proper steps to solve it. This includes first coming up with a plan or outline using pseudocode, and then solving it in different ways starting with the simplest solution.

Python Coding Question

We need to write a function that takes a single integer value as input, and returns the sum of the integers from zero up to and including that input. The function should return 0 if a non-integer value is passed in.

So if we pass in the number 5 to the function, then it would return the sum of the integers 0 through 5, or (0+1+2+3+4+5) , which equals 15. If we pass in any other data type other than an integer, such as a string, or float, etc… the function should return 0.

How to Slice Sequences in Python

Learn how to slice lists and strings in python.

towardsdatascience.com

Formulate a Plan

The first thing we should do is solve this problem using pseudocode. Pseudocode is just a way to plan out our steps without worrying about the coding syntax.

We can try something like this:

We defined a function, add , that takes in an input, num . Within the add function, we write an outline of steps using comments. If the value passed to the function is an integer, then we will add the integers 0 through that value, and then return the sum. If the value passed to the function is not an integer, then we simply return 0. After that, we write a few examples of what we want our output to be given a specific input.

Let’s expand on this step in the pseudocode above:

This step can be done in many ways. What would the pseudocode look like if we attempt this step using a for loop?

Let’s try solving it based on the blueprint we created above!

Using a For Loop

We can solve this prompt using a for loop as follows:

Let’s dissect the code below.

We first check if the value passed in, num , is an integer using the type function.

If the type is an integer, we create a sum variable and assign it the value 0.

We then loop over the integers starting from 0 through the integer passed in to our function using a for loop and the range function. Remember that the range function creates a range object , which is an iterable object, that starts at 0 (if we don’t specify a start value), and goes to the integer less than the stop value (since the stop value is exclusive). That is why we need to add 1 to the stop value ( num+1 ), since we want to add up all the integers from 0 up to and including that number, num .

range (start, stop[, step])

The range function will create a range object, which is an iterable object, and thus we can use a for loop to loop through it. As we are looping through this iterable object, we are adding each number, or x , to the sum variable.

Then after the for loop iterations are complete, the function returns the sum.

Lastly, if the number passed in is not an integer, we return 0.

This is the code without the comments:

If we test our add function, we get the correct outputs:

This is a good way to solve this coding problem and it gets the job done. It is easy to read and works correctly. But, in my opinion, by trying to solve this question in other ways, we can perhaps extract more value from it by utilizing our other python knowledge along with our problem-solving skills. These other ways may or may not be more pythonic, but it can be quite fun and useful to think of different ways to solve the same problem.

Let’s try to solve this coding question in a different way.

For more information on iterable objects:

Three Concepts to Become a Better Python Programmer

Learn about the * and ** operators, *args and **kwargs, and more in python, using reduce function.

We recently learned what the reduce function does in a previous tutorial. The reduce function takes an iterable object and reduces it down to a single cumulative value. The reduce function can take in three arguments, two of which are required. The two required arguments are: a function (that itself takes in two arguments), and an iterable object.

We can use the reduce function to find the sum of an iterable object.

Thus, instead of a for loop, we can use reduce to solve our Python problem:

And that’s it! We use a lambda function as the function argument and the range object as our iterable object. The reduce function then reduces our range object down to a single value, the sum. And then we return that sum.

For more information about the reduce function:

Three Functions to Know in Python

Learn how to use the map, filter, and reduce functions in python, using ternary operators.

We can shorten our code even more by using ternary operators. Using ternary operators, we can shorten our if/else statement above into one line using the following format:

x if C else y
C is our condition, which is evaluated first. If it evaluates to True, then x is evaluated and its value will be returned. Otherwise, y is evaluated and its value is returned.

We can implement this into our code as follows:

And through these changes, we managed to reduce the code within our function down to a single line. It may not be the most readable or pythonic way of solving this problem, but in my opinion, it helps us improve our coding and problem-solving skills by forcing us to figure out different ways to solve the same problem.

Let’s see if we can solve this coding question in another way.

For more information on ternary operators:

Ternary Operators in Python

Improve your python code with ternary operators, sum() function.

We can solve this coding question a different way using Python’s built-in sum function. The sum() function can take in an iterable object and returns the sum of its elements. We can also pass in a start value if we want it to be added to the elements first.

sum(iterable, start)

Let’s solve the coding question using the sum function:

And that’s it! This is likely the best way to solve this coding question, as it is both the most concise and easy to read solution. In addition, it likely will have the best performance as well.

For more information on code performance:

Become a More Efficient Python Programmer

Learn the best ways to create lists and accomplish other tasks in python.

If you enjoy reading stories like these and want to support me as a writer, consider signing up to become a Medium member. It’s $5 a month, giving you unlimited access to stories on Medium. If you sign up using my link , I’ll earn a small commission.

Join Medium with my referral link — Luay Matalka

Read every story from luay matalka (and thousands of other writers on medium). your membership fee directly supports….

lmatalka90.medium.com

In this tutorial, we learned that solving a Python problem using different methods can enhance our coding and problem-solving skills by broadening our knowledge base. We looked at an example python coding question and went through the steps of solving it. We first planned how we were going to solve it using pseudocode. Then we implemented this outline of steps by first solving the prompt through the use of a for loop. Later, we solved the same problem using the reduce function. We also implemented ternary operators to shorten our code even further but still maintained readability. Lastly, we used the Python built-in sum function along with ternary operators to come up with the shortest but still most pythonic solution.

More from Towards Data Science

Your home for data science. A Medium publication sharing concepts, ideas and codes.

About Help Terms Privacy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store

Luay Matalka

Cloud Data Engineer with a passion for teaching.

Text to speech

EasyEngineering

[PDF] GE8151 Problem Solving and Python Programming (PSPP) Books, Lecture Notes, 2 marks with answers, Important Part B 13 marks Questions, Multiple Choice Questions (MCQs), Question Bank & Syllabus

Easyengineering whatsapp group

Download GE8151 Problem Solving and Python Programming (PSPP) Books Lecture Notes Syllabus Part A 2 marks with answers GE8151 Problem Solving and Python Programming (PSPP) Important Part B 13 marks, Direct 16 Mark Questions and Part C 15 marks Questions , PDF Books, Question Bank with answers Key, GE8151 Problem Solving and Python Programming (PSPP) Syllabus & Anna University GE8151 Problem Solving and Python Programming (PSPP) Question Papers Collection.

Download link is provided and students can download the Anna University GE8151 Problem Solving and Python Programming (PSPP) Syllabus Question bank Lecture Notes Part A 2 marks with answers Part B 13 marks and Part C 15 marks Question Bank with answer , All the materials are listed below for the students to make use of it and score good (maximum) marks with our study materials.

“GE8151 Problem Solving and Python Programming (PSPP) Notes,Lecture Notes, Previous Years Question Papers”

“GE8151 Problem Solving and Python Programming (PSPP) Important 13 marks & 15 marks Questions with Answers”

“GE8151 Problem Solving and Python Programming (PSPP) Important 2 marks & 16 marks Questions with Answers”

“GE8151 Problem Solving and Python Programming (PSPP) Multiple Choice Questions (MCQs) with Answers”

“GE8151 Problem Solving and Python Programming (PSPP) Important Part A & Part B Questions”

“GE8151 Problem Solving and Python Programming (PSPP) Syllabus, Local Author Books, Question Banks”

You all must have this kind of questions in your mind. Below article will solve this puzzle of yours. Just take a look and download the study materials.

GE8151 Problem Solving and Python Programming (PSPP) Part A & Part B Important Questions with Answers, Multiple Choice Questions (MCQs) var td_screen_width = window.innerWidth; if ( td_screen_width >= 1140 ) { /* large monitors */ document.write(' Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 1019 && td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 768 && td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); }

GE8151 Problem Solving and Python Programming (PSPP) Study Materials – Details

GE8151 Problem Solving and Python Programming (PSPP) Syllabus

UNIT I ALGORITHMIC PROBLEM SOLVING

Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation (pseudo code, flow chart, programming language), algorithmic problem solving, simple strategies for developing algorithms (iteration, recursion). Illustrative problems: find minimum in a list, insert a card in a list of sorted cards, guess an integer number in a range, Towers of Hanoi.

UNIT II DATA, EXPRESSIONS, STATEMENTS

Python interpreter and interactive mode; values and types: int, float, boolean, string, and list; variables, expressions, statements, tuple assignment, precedence of operators, comments; modules and functions, function definition and use, flow of execution, parameters and arguments; Illustrative programs: exchange the values of two variables, circulate the values of n variables, distance between two points.

UNIT III CONTROL FLOW, FUNCTIONS

Conditionals: Boolean values and operators, conditional (if), alternative (if-else), chained conditional (if-elif-else); Iteration: state, while, for, break, continue, pass; Fruitful functions: return values, parameters, local and global scope, function composition, recursion; Strings: string slices, immutability, string functions and methods, string module; Lists as arrays. Illustrative programs: square root, gcd, exponentiation, sum an array of numbers, linear search, binary search.

UNIT IV LISTS, TUPLES, DICTIONARIES

Lists: list operations, list slices, list methods, list loop, mutability, aliasing, cloning lists, list parameters; Tuples: tuple assignment, tuple as return value; Dictionaries: operations and methods; advanced list processing – list comprehension; Illustrative programs: selection sort, insertion sort, mergesort, histogram.

UNIT V FILES, MODULES, PACKAGES

Files and exception: text files, reading and writing files, format operator; command line arguments, errors and exceptions, handling exceptions, modules, packages; Illustrative programs: word count, copy file.

Download Link

Anna University GE8151 Problem Solving and Python Programming (PSPP) Books Question banks Lecture Notes Syllabus GE8151 Problem Solving and Python Programming (PSPP) Part A 2 marks with answers Part B 13 marks Questions, 16 marks Questions & Part C 15 marks Questions with answers & Anna University GE8151 Problem Solving and Python Programming (PSPP) Question Papers Collection and Local Author Books.

Click below the link “DOWNLOAD” to save the Study Material (PDF)

Kindly Note : They different collections of GE8151 Problem Solving and Python Programming (PSPP) Study materials are listed below. Each collection is different from others, Based on candidates (your) knowledge & requirement choose the suitable material for your preparations.

GE8151 Problem Solving and Python Programming (PSPP) Multiple Choice Questions (MCQs)

GE8151 Problem Solving and Python Programming (PSPP) Lecture Notes

GE8151 Problem Solving and Python Programming (PSPP) unit wise 2 marks Question with Answers

GE8151 Problem Solving and Python Programming (PSPP) unit wise 13 marks,15 marks & 16 marks Question with answers

GE8151 Problem Solving and Python Programming (PSPP) Important Questions

Important Questions Collection 1 – DOWNLOAD

GE8151 Problem Solving and Python Programming (PSPP) Question Papers Collections

GE8151 Problem Solving and Python Programming (PSPP) Question Bank

Anna University Useful Links

Other Useful Links

We need Your Support, Kindly Share this Web Page with Other Friends

If you have any Engg study materials with you kindly share it, It will be useful to other friends & We Will Publish The Book/Materials Submitted By You Immediately Including The Book/Materials Credits (Your Name) Soon After We Receive It (If The Book/Materials Is Not Posted Already By Us)

Submit Your Books/Study Materials

If You Think This Materials Is Useful, Kindly Share it .

Thank you for visiting my thread. Hope this post is helpful to you. Have a great day !

Kindly share this post with your friends to make this exclusive release more useful.

GE8151 Problem Solving and Python Programming (PSPP) – FAQ

Q1. what is the full form of the subject code ge8151.

The Full Form of Subject Code GE8151 is Problem Solving and Python Programming (PSPP) .

Q2. How to Download GE8151 Notes?

The students can download the GE8151 Problem Solving and Python Programming (PSPP) Part-A 2 marks , Part-B 13 marks and Part-C 15 marks questions with answers (Notes) on the EasyEngineering website for preparing their upcoming first semester examination.

Q3. Where to Download GE8151 Local Author Book PDF?

On the EasyEngineering GE8151 Problem Solving and Python Programming (PSPP) page, the students can download the Local Author Book PDF , which contains unit wise Part-A 2 marks, Part-B 13 marks and Part-C 15 marks important questions with answers.

Q4. How to Download Previous Years GE8151 Question Papers?

The Anna University students can download the GE8151 Problem Solving and Python Programming (PSPP) Previous Years Question Papers Collection on the GE8151 Question Papers Page, which contains the last 5 years question papers sets (GE8151 Question Bank) for the students to prepare for their upcoming first semester examination.

Q5. In which regulation semester exam GE8151 subject is studied?

The GE8151 Problem Solving and Python Programming (PSPP) subject is studied by the Anna University Students of First Year in their First Semester Examination of 2017 Regulation .

Q6. How to download GE8151 Part-A 2 Mark Questions with Answers?

On the EasyEngineering website, the students can download the GE8151 Problem Solving and Python Programming (PSPP) Part-A 2 mark Questions with answers. These GE8151 notes are useful for those candidates who are preparing for their upcoming first semester examination of Anna University.

Q7. How to download GE8151 Part-B 13 Mark Questions with Answers?

The students can download the GE8151 Problem Solving and Python Programming (PSPP) Part-B 13 mark Questions with answers on the EasyEngineering webpage for preparing their upcoming Anna University first semester examination.

Q8. How to download GE8151 Part-C 15 Mark Questions with Answers?

The GE8151 Problem Solving and Python Programming (PSPP) Part-C 15 Mark Questions with answers are available to download on the EasyEngineering website for preparing the upcoming Anna University first semester examination. This Part-C is considered as very important section in the regulation 2017 in which the students are focus to answer the questions because the answer for this section is allotted as 15 Marks .

Q9. How to download Anna University GE8151 syllabus?

The GE8151 Problem Solving and Python Programming (PSPP) Syllabus is directly downloaded from the Anna University Regulation 2017 Syllabus page on the EasyEngineering.

Q10. How to check Anna University GE8151 Internal Marks?

The GE8151 Problem Solving and Python Programming (PSPP) Anna University Internal marks can be check by the students from the official portal of Anna University ( coe1.annauniv.edu ) . The steps to check the Anna University Internal marks are clearly explained in the EasyEngineering Anna University Internal Mark checking page.

Q11. How to check Anna University GE8151 exam results?

The GE8151 Problem Solving and Python Programming (PSPP) Anna University semester examination results can be check by the students from the official result checking pages/portals (i.e., aucoe.annauniv.edu or coe1.annauniv.edu ). Also, In the EasyEngineering website the Results checking page are available to check the Anna University current semester examination results quickly.

Q12. How to check Anna University GE8151 Grace marks details?

In the Easyengineering GE8151 Problem Solving and Python Programming (PSPP) page contains the grace mark details to notify the students to know about the grace marks provided by Anna University for the invalid or out of portions/syllabus questions asked in the current first semester GE8151 exam.

Q13. Which Engineering department is studying the GE8151 as one subject?

The GE8151 Problem Solving and Python Programming (PSPP) subject is studied by the Anna University First year students of Common for all Engineering department as one subject in their first semester examination.

Related Posts You May Also Like

Your comments about this post, is our service is satisfied, anything want to say cancel reply.

Notify me of follow-up comments by email.

Notify me of new posts by email.

Trending Today

problem solving and python programming important questions

[PDF] Mechanical Vibrations Book By V.P. Singh Free Download

Probability, Statistics, and Random Processes For Electrical Engineering By Alberto Leon-Garcia

[PDF] Probability, Statistics, and Random Processes For Electrical Engineering By Alberto...

Get new updates email alerts, join with us, today updates.

IES Civil Engineering Subjective Previous Years Papers

[PDF] UPSC IES/ESE Civil Engineering Subjective Previous Years Papers Collections Free...

IES Civil Engineering Objective Previous Years Paper

[PDF] UPSC IES/ESE Civil Engineering Objective Previous Years Papers Collections Free...

Accident Lawyer Orlando USA

Accident Lawyer Orlando USA

Electrical Engineering GATE Previous Years Question Papers Collections With Key

[PDF] Electrical Engineering GATE Previous Years Question Papers Collections With Key...

Electronics and Communication Engineering GATE Previous Years Question Papers Collections With Key (Solutions)

[PDF] Electronics and Communication Engineering GATE Previous Years Question Papers Collections...

Mechanical Engineering Previous Years GATE Solved Question Papers Collection – PDF Free Download

[PDF] Mechanical Engineering GATE Previous Years Question Papers Collections With Key...

Civil Engineering GATE Previous Years Question Papers Collections

[PDF] Civil Engineering GATE Previous Years Question Papers Collections With Key...

Popular files.

Civil Engineering Books (Subject wise)  Huge Collections – PDF Free Download

[PDF] Civil Engineering Books Huge Collections (Subject wise) Free Download

Higher Engineering Mathematics By B.S. Grewal - Free Download PDF

[PDF] Higher Engineering Mathematics By B.S. Grewal Book Free Download

Strength Of Materials Book (PDF) By Dr.R.K.Bansal – PDF Free Download

[PDF] A Textbook of Strength of Materials By Dr.R.K.Bansal Book Free...

Estimation and Costing By B.N. Dutta

[PDF] Estimation and Costing By B.N. Dutta Free Downlaod

IES Master Institute for Engineering IES, GATE & PSU’s Study Materials - FREE DOWNLOAD PDF

IES Master Institute for Engineering IES, GATE & PSU’s Study Materials...

Trending on easyengineering.net.

EE6404 Measurements and Instrumentation

[PDF] EE6404 Measurements and Instrumentation (MI) Books, Lecture Notes, 2marks with...

problem solving and python programming important questions

[PDF] Made Easy Thermodynamics Handwritten Classroom Notes for IES IAS GATE...

[PDF] An Introduction to Soil Mechanics and Foundations By C.R. Scott Book Free Download

[PDF] An Introduction to Soil Mechanics and Foundations By C.R. Scott...

problem solving and python programming important questions

MA6459 Numerical Methods (NM) Books, Lecture Notes, 2marks with answers, Important...

problem solving and python programming important questions

[PDF] Engineering Thermodynamics Through Examples By Y.V.C. Rao – Free Download

problem solving and python programming important questions

EC6201 Electronic Devices, Question bank , Notes Syllabus 2 marks with...

Arihant Current Affairs Yearly 2017

[PDF] Arihant Current Affairs Yearly 2017 By Arihant Experts (Arihant Publications)...

problem solving and python programming important questions

[PDF] GATE Mechanical Engineering Study Materials Collection Free Download

Sponsored by.

problem solving and python programming important questions

Website Designed and Maintained by EasyEngineering Network | Website CDN by   MaxCDN   |   Website Security by   Sucuri .

Check your Email after Joining and Confirm your mail id to get updates alerts.

...Join Now...

Search Your Files

Join with us.

problem solving and python programming important questions

Sri Krishna Institute Highway & Traffic Engineering Handwritten Classroom Notes

[PDF] Sri Krishna Institute Highway & Traffic Engineering New Edition Classroom...

Join our Telegram Group & Share your contents, doubts, knowledge with other Students/Graduates 

Join our Telegram Group

DevOps Engineering - Planning to Production

Related Articles

Top 40 Python Interview Questions & Answers

Python is a general-purpose, high-level programming language. It is the most popular language among developers and programmers as it can be used in Machine Learning, Web Development, Image Processing, etc. Currently a lot of tech companies like Google, Amazon, Facebook, etc. are using Python and hire a lot of people every year. We have prepared a list of Top 40 Python Interview Questions along with their Answers.

1. What is Python? List some popular applications of Python in the world of technology?

Python is a widely-used general-purpose, high-level programming language. It was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation. It was designed with an emphasis on code readability, and its syntax allows programmers to express their concepts in fewer lines of code. It is used for:

2. What are the benefits of using Python language as a tool in the present scenario?

Following are the benefits of using Python language:

3. Which sorting technique is used by sort() and sorted() functions of python?

Python uses Tim Sort algorithm for sorting. It’s a stable sorting whose worst case is O(N log N). It’s a hybrid sorting algorithm, derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data.

4. Differentiate between List and Tuple?

Let’s analyze the differences between List and Tuple:

To read more, refer the article: List vs Tuple

5. How memory management is done in Python? Python uses its private heap space to manage the memory. Basically, all the objects and data structures are stored in the private heap space. Even the programmer can not access this private space as the interpreter takes care of this space. Python also has an inbuilt garbage collector, which recycles all the unused memory and frees the memory and makes it available to the heap space.

To read more, refer the article: Memory Management in Python

6. What is PEP 8?

PEP 8 is a Python style guide. It is a document that provides the guidelines and best practices on how to write beautiful Python code. It promotes a very readable and eye-pleasing coding style.

To read more, refer the article: PEP 8 coding style

7. Is Python a compiled language or an interpreted language?

Actually, Python is a partially compiled language and partially interpreted language. The compilation part is done first when we execute our code and this will generate byte code and internally this byte code gets converted by the python virtual machine(p.v.m) according to the underlying platform(machine+operating system).

To read more, refer the article: Python – Compiled or Interpreted?

8. How to delete a file using Python?

We can delete a file using Python by following approaches:

9. What are Decorators?

Decorators are a very powerful and useful tool in Python as they are the specific change that we make in Python syntax to alter functions easily.

To read more, refer the article: Decorators in Python

10. What is the difference between Mutable datatype and Immutable datatype?

Mutable data types can be edited i.e., they can change at runtime. Eg – List, Dictionary, etc. Immutable data types can not be edited i.e., they can not change at runtime. Eg – String, Tuple, etc.

11. What is the difference between Set and Dictionary?

Set is an unordered collection of data type that is iterable, mutable, and has no duplicate elements. Dictionary in Python is an unordered collection of data values, used to store data values like a map.

To read more, refer the article: Sets and Dictionary

12. How do you debug a Python program?

By using this command we can debug a python program:

13. What is Pickling and Unpickling?

Pickle module accepts any Python object and converts it into a string representation and dumps it into a file by using the dump function, this process is called pickling. While the process of retrieving original Python objects from the stored string representation is called unpickling.

To read more, refer to the article: Pickle module in Python

14. How are arguments passed by value or by reference in Python? Everything in Python is an object and all variables hold references to the objects. The reference values are according to the functions; as a result, you cannot change the value of the references. However, you can change the objects if it is mutable.

15. What is List Comprehension? Give an Example.

List comprehension is a syntax construction to ease the creation of a list based on existing iterable.

For Example:

16. What is Dictionary Comprehension? Give an Example

Dictionary Comprehension is a syntax construction to ease the creation of a dictionary based on the existing iterable.

For Example: my_dict = {i:1+7 for i in range(1, 10)}

17. Is Tuple Comprehension? If yes, how and if not why?

Tuple comprehension is not possible in Python because it will end up in a generator, not a tuple comprehension.

18. What is namespace in Python?

A namespace is a naming system used to make sure that names are unique to avoid naming conflicts.

To read more, refer to the article: Namespace in Python

19. What is a lambda function?

A lambda function is an anonymous function. This function can have any number of parameters but, can have just one statement. For Example:

To read more, refer to the article: Lambda functions

20. What is a pass in Python?

Pass means performing no operation or in other words, it is a place holder in the compound statement, where there should be a blank left and nothing has to be written there.

21. What is the difference between xrange and range function?

range() and xrange() are two functions that could be used to iterate a certain number of times in for loops in Python. In Python 3, there is no xrange, but the range function behaves like xrange in Python 2.

To read more, refer to the article: Range vs Xrange

22. What is difference between / and // in Python?

// represents floor division whereas / represents precised division. For Example:

23. What is zip function?

Python zip() function returns a zip object, which maps a similar index of multiple containers. It takes an iterable, converts into iterator and aggregates the elements based on iterables passed. It returns an iterator of tuples.

24. What is swapcase function in Python?

It is a string’s function that converts all uppercase characters into lowercase and vice versa. It is used to alter the existing case of the string. This method creates a copy of the string which contains all the characters in the swap case. For Example:

25. What are Iterators in Python?

In Python, iterators are used to iterate a group of elements, containers like a list. Iterators are the collection of items, and it can be a list, tuple, or a dictionary. Python iterator implements __itr__ and the next() method to iterate the stored elements. In Python, we generally use loops to iterate over the collections (list, tuple).

To read more, refer the article: Iterators in Python

26. What are Generators in Python?

In Python, the generator is a way that specifies how to implement iterators. It is a normal function except that it yields expression in the function. It does not implements __itr__ and next() method and reduces other overheads as well.

If a function contains at least a yield statement, it becomes a generator. The yield keyword pauses the current execution by saving its states and then resumes from the same when required.

To read more, refer the article: generators in Python

27. What are the new features added in Python 3.8 version?

Following are the new features in Python 3.8 version:

To read more, refer the article: Awesome features in Python 3.8

28. What is monkey patching in Python?

In Python, the term monkey patch only refers to dynamic modifications of a class or module at run-time.

To read more, refer the article: Monkey patching in Python

29. Does Python supports multiple Inheritance?

Python does support multiple inheritance, unlike Java. Multiple inheritance means that a class can be derived from more than one parent classes.

30. What is Polymorphism in Python?

Polymorphism means the ability to take multiple forms. So, for instance, if the parent class has a method named ABC then the child class also can have a method with the same name ABC having its own parameters and variables. Python allows polymorphism.

To read more, refer the article: Polymorphism in Python

31. Define encapsulation in Python?

Encapsulation means binding the code and the data together. A Python class is an example of encapsulation.

To read more, refer the article: Encapsulation in Python

32. How do you do data abstraction in Python?

Data Abstraction is providing only the required details and hiding the implementation from the world. It can be achieved in Python by using interfaces and abstract classes.

To read more, refer the article: Abstraction in Python

33. Which databases are supported by Python?

MySQL (Structured) and MongoDB (Unstructured) are the prominent databases that are supported natively in Python. Import the module and start using the functions to interact with the database.

34. How is Exceptional handling done in Python?

There are 3 main keywords i.e. try, except, and finally which are used to catch exceptions and handle the recovering mechanism accordingly. Try is the block of a code which is monitored for errors. Except block gets executed when an error occurs.

The beauty of the final block is to execute the code after trying for error. This block gets executed irrespective of whether an error occurred or not. Finally block is used to do the required cleanup activities of objects/variables.

35. What does ‘#’ symbol do in Python?

‘#’ is used to comment out everything that comes after on the line.

36. Write a code to display the current time?

37. What is the difference between a shallow copy and deep copy?

Shallow copy is used when a new instance type gets created and it keeps values that are copied whereas deep copy stores values that are already copied.

A shallow copy has faster program execution whereas deep coy makes it slow.

To read more, refer the article: Shallow copy vs Deep copy

38. What is PIP?

PIP is an acronym for Python Installer Package which provides a seamless interface to install various Python modules. It is a command-line tool that can search for packages over the internet and install them without any user interaction.

To read more, refer the article: PIP in Python

39. What is __init__() in Python?

Equivalent to constructors in OOP terminology, __init__ is a reserved method in Python classes. The __init__ method is called automatically whenever a new object is initiated. This method allocates memory to the new object as soon as it is created. This method can also be used to initialize variables.

40. What is the maximum possible length of an identifier?

Identifiers in Python can be of any length.

Please Login to comment...

Complete Test Series for Service-Based Companies

Data structures and algorithms - self paced, complete interview preparation - self paced, improve your coding skills with practice, start your coding journey now.

LearnEngineering.in

[PDF] GE3151 Problem Solving and Python Programming (PSPP) Books, Lecture Notes, 2 marks with answers, Important Part B 16 Marks Questions, Question Bank & Syllabus

Download GE3151 Problem Solving and Python Programming (PSPP) Books Lecture Notes Syllabus Part-A 2 marks with answers GE3151 Problem Solving and Python Programming Important Part-B 16 marks Questions , PDF Books, Question Bank with answers Key, GE3151 Problem Solving and Python Programming Syllabus & Anna University GE3151 Problem Solving and Python Programming Question Papers Collection.

Students Click to Join our WhatsApp Group | Telegram Channel

Download link is provided for Students to download the Anna University GE3151 Problem Solving and Python Programming Syllabus Question Bank Lecture Notes Part A 2 marks with answers & Part B 16 marks Question Bank with answer , Anna University Question Paper Collection, All the materials are listed below for the students to make use of it and get good (maximum) marks with our study materials.

“GE3151 Problem Solving and Python Programming Notes, Lecture Notes, Previous Years Question Papers “

“GE3151 Problem Solving and Python Programming Important 16 marks Questions with Answers”

“GE3151 Problem Solving and Python Programming Important 2 marks & 16 marks Questions with Answers”

“GE3151 Problem Solving and Python Programming Important Part A & Part B Questions”

“GE3151 Problem Solving and Python Programming Syllabus, Local Author Books, Question Banks”

You all must have this kind of questions in your mind. Below article will solve this puzzle of yours. Just take a look and download the study materials for your preparation.

GE3151 Problem Solving and Python Programming (PSPP) Notes Part A & Part B Important Questions with Answers var td_screen_width = window.innerWidth; if ( td_screen_width >= 1140 ) { /* large monitors */ document.write(' Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 1019 && td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 768 && td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width Download Links '); (adsbygoogle = window.adsbygoogle || []).push({}); } .u73196f2208c6172235ead104f53e3eb5 { padding:0px; margin: 0; padding-top:1em!important; padding-bottom:1em!important; width:100%; display: block; font-weight:bold; background-color:inherit; border:0!important; border-left:4px solid #2ECC71!important; text-decoration:none; } .u73196f2208c6172235ead104f53e3eb5:active, .u73196f2208c6172235ead104f53e3eb5:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; text-decoration:none; } .u73196f2208c6172235ead104f53e3eb5 { transition: background-color 250ms; webkit-transition: background-color 250ms; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; } .u73196f2208c6172235ead104f53e3eb5 .ctaText { font-weight:bold; color:#E74C3C; text-decoration:none; font-size: 16px; } .u73196f2208c6172235ead104f53e3eb5 .postTitle { color:#000000; text-decoration: underline!important; font-size: 16px; } .u73196f2208c6172235ead104f53e3eb5:hover .postTitle { text-decoration: underline!important; } Also Check :   [PDF] ME3393 Manufacturing Processes (MP) Books, Lecture Notes, 2 marks with answers, Important Part B 16 Marks Questions, Question Bank & Syllabus var td_screen_width = window.innerWidth; if ( td_screen_width >= 1140 ) { /* large monitors */ document.write(' '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 1019 && td_screen_width '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width >= 768 && td_screen_width '); (adsbygoogle = window.adsbygoogle || []).push({}); } if ( td_screen_width '); (adsbygoogle = window.adsbygoogle || []).push({}); }

GE3151 Problem Solving and Python Programming – Study Materials – Details

GE3151 Problem Solving and Python Programming (PSPP) “R2021 – SYLLABUS”

GE3151 PROBLEM SOLVING AND PYTHON PROGRAMMING

UNIT I COMPUTATIONAL THINKING AND PROBLEM SOLVING

Fundamentals of Computing – Identification of Computational Problems -Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation (pseudo code, flow chart, programming language), algorithmic problem solving, simple strategies for developing algorithms (iteration, recursion). Illustrative problems: find minimum in a list, insert a card in a list of sorted cards, guess an integer number in a range, Towers of Hanoi.

UNIT II DATA TYPES, EXPRESSIONS, STATEMENTS

Python interpreter and interactive mode, debugging; values and types: int, float, boolean, string, and list; variables, expressions, statements, tuple assignment, precedence of operators, comments; Illustrative programs: exchange the values of two variables, circulate the values of n variables, distance between two points.

UNIT III CONTROL FLOW, FUNCTIONS, STRINGS

Conditionals: Boolean values and operators, conditional (if), alternative (if-else), chained conditional (if-elif-else); Iteration: state, while, for, break, continue, pass; Fruitful functions: return values, parameters, local and global scope, function composition, recursion; Strings: string slices, immutability, string functions and methods, string module; Lists as arrays. Illustrative programs: square root, gcd, exponentiation, sum an array of numbers, linear search, binary search.

UNIT IV LISTS, TUPLES, DICTIONARIES

Lists: list operations, list slices, list methods, list loop, mutability, aliasing, cloning lists, list parameters; Tuples: tuple assignment, tuple as return value; Dictionaries: operations and methods; advanced list processing – list comprehension; Illustrative programs: simple sorting, histogram, Students marks statement, Retail bill preparation.

UNIT V FILES, MODULES, PACKAGES

Files and exception: text files, reading and writing files, format operator; command line arguments, errors and exceptions, handling exceptions, modules, packages; Illustrative programs: word count, copy file, Voter’s age validation, Marks range validation (0-100).

  TEXT BOOKS:

REFERENCES:

DOWNLOAD LINK

Anna University GE3151 Problem Solving and Python Programming Books Question Banks Lecture Notes Syllabus GE3151 Problem Solving and Python Programming Part A 2 Marks with Answers Part – B 16 Marks Questions with Answers & Anna University GE3151 Problem Solving and Python Programming Question Paper Collection and Local Author Books.

Click below the link “DOWNLOAD” to save the Book/Material (PDF)

Kindly Note : There are different collection of GE3151 Problem Solving and Python Programming study materials are listed below. Based on your requirement choose the suitable material for your preparation.

GE3151 Problem Solving and Python Programming Lecture Notes

Ge3151 lecture notes collection 01 – download, ge3151 lecture notes collection 02 – download, ge3151 lecture notes collection 03 – download, ge3151 lecture notes collection 04 – download, ge3151 lecture notes collection 05 – download, ge3151 problem solving and python programming unit wise 2 marks question with answers, ge3151 2 marks collection 01 – download, ge3151 2 marks collection 02 – download, ge3151 important question collection 03 – download, ge3151 important question collection 04 – download, ge3151 problem solving and python programming unit wise 2 marks, 16 marks questions with answers, ge3151 student notes collection 01 – download, ge3151 student notes collection 02 – download, ge3151 student notes collection 03 – download, ge3151 student notes collection 04 – download, ge3151 student notes collection 05 – download, ge3151 problem solving and python programming important questions & question bank collection, ge3151 questions bank collection 01 – download, ge3151 questions bank collection 02 – download, ge3151 questions bank collection 03 – download, ge3151 problem solving and python programming anna university question paper collection, ge3151 anna university question papers collection 01 – download, ge3151 anna university question papers collection 02 – download, ge3151 previous year collection  – download.

We need Your Support, Kindly Share this Web Page with Other Friends

If you have any Engg study materials with you kindly share it, It will be useful to other friends & We Will Publish The Book/Materials Submitted By You Immediately Including The Book/Materials Credits (Your Name) Soon After We Receive It (If The Book/Materials Is Not Posted Already By Us)

If You Think This Materials Is Useful, Kindly Share it .

problem solving and python programming important questions

Click Here To Check Anna University Recent Updates.

Click here to download anna university ug/ pg regulation 2021 syllabus ., click here to check anna university results, other useful links, click here to download other semester civil engineering r2021 study material., click here to download other semester cse r2021 study material., click here to download other semester ece r2021 study material., click here to download other semester eee r2021 study material., click here to download other semester mechanical engineering r2021 study material., click here to download department wise r2017 & r2013 study materials., click here to download gate exam study materials., click here to download competitive exam (rrb & ssc) study materials., click here to download competitive exam (iit – jee exam) study materials., click here to download engineering text books (all departments) collection..

Thank you for visiting my thread. Hope this post is helpful to you. Have a great day !

Kindly share this post with your friends to make this exclusive release more useful.

Related Posts You May Also Like

Your comments about this post, leave a reply cancel reply.

Save my name, email, and website in this browser for the next time I comment.

Notify me of follow-up comments by email.

Notify me of new posts by email.

Trending Today

Automotive Exhaust Emissions and Energy Recovery By Apostolos Pesiridis

[PDF] Automotive Exhaust Emissions and Energy Recovery By Apostolos Pesiridis Free...

All time trending.

problem solving and python programming important questions

[PDF] CS6403 Software Engineering Lecture Notes, Books, Important 2 Marks Questions...

Get new updates email alerts.

Enter your E- Mail Address to Subscribe this Blog and Receive Notifications of New Posts by E-Mail.

problem solving and python programming important questions

Today Updates

Wave Theory (Physics) Notes for IIT-JEE Exam

[PDF] Wave Theory (Physics) Notes for IIT-JEE Exam Free Download

Guide to Scientific Computing in C++ By Joe Pitt-Francis

[PDF] Guide to Scientific Computing in C++ By Joe Pitt-Francis and...

Ace Academy Fluid Mechanics Handwritten Notes

[PDF] Ace Academy Fluid Mechanics Handwritten Notes for IES IAS GATE...

Architecture Books Collection

[PDF] Architecture Books Collection Free Download

Complex Analysis By Joseph Bak

[PDF] Complex Analysis By Joseph Bak and Donald J. Newman Free...

Computer Hacking Books Collection

[PDF] Computer Hacking Books Collection Free Download

FRP Composites for Reinforced and Prestressed Concrete Structures By Perumalsamy Balaguru

[PDF] FRP Composites for Reinforced and Prestressed Concrete Structures By Perumalsamy...

Popular files.

EN6501 Municipal Solid Waste Management

[PDF] EN6501 Municipal Solid Waste Management Lecture Notes, Books, Important 2...

problem solving and python programming important questions

[PDF] EE6010 High Voltage Direct Current Transmission Lecture Notes, Books, Important...

ME6701 Power Plant Engineering

[PDF] ME6701 Power Plant Engineering Lecture Notes, Books, Important 2 Marks...

problem solving and python programming important questions

[PDF] CE6016 Prefabricated Structures Lecture Notes, Books, Important 2 Marks Questions...

CS6502 Object Oriented Analysis and Design

[PDF] CS6502 Object Oriented Analysis and Design Lecture Notes, Books, Important...

PR8592 Welding Technology

PR8592 Welding Technology Lecture Notes, Books, Important Part-A 2 Marks Questions...

Trending on learnengineering.in.

Descriptive English By K.Kundan

[PDF] Descriptive English By K.Kundan for Bank Exam Free Download

Physics Formula Book By Resonance Eduventures Limited

[PDF] Physics Formula Book By Resonance Eduventures Limited for IIT-JEE Exam...

IES Electrical Engineering Subjective Previous Years Papers Collection

[PDF] Engineering Service Exam(IES ESE) Subjective Electrical Engineering Previous Years Papers...

Arithmetic for SSC (English) By Rakesh Yadav

[PDF] Arithmetic for SSC (English) By Rakesh Yadav for SSC Exam...

Rotational Motion (Physics) Notes for IIT-JEE Exam

[PDF] Rotational Motion (Physics) Notes for IIT-JEE Exam Free Download

Grb A Textbook Of Physical Chemistry For Competitions For JEE (Main & Advanced) By Dr.A. S. Singh

[PDF] Grb A Textbook Of Physical Chemistry For Competitions For JEE...

Mathematics By V.K. Gupta and A.K. Bansal

[PDF] Mathematics By V.K. Gupta and A.K. Bansal for IIT-JEE Exam...

Sponsored by.

Website Designed and Maintained by LearnEngineering Network | Website CDN by   MaxCDN   |   Website Security by   Sucuri .

Check your Email after Joining and Confirm your mail id to get updates alerts.

...Join Now...

Search Your Files

problem solving and python programming important questions

Join our Telegram Group & Share your contents, doubts, knowledge with other Students/Graduates 

problem solving and python programming important questions

Problem Solving and Python Programming - GE3151, GE8151

Important questions and answers, online study material, lecturing notes, assignment, reference, wiki.

Problem Solving and Python Programming

Problem Solving and Python Programming

Unit i: computational thinking and problem solving, unit ii: data types, expressions, statements, unit iii: control flow, functions, strings, unit iv: lists, tuples, dictionaries, unit i : algorithmic problem solving, unit ii : data expressions statements, unit iii : control flow functions, unit iv : lists tuples dictionaries, unit v : files modules packages.

Privacy Policy , Terms and Conditions , DMCA Policy and Compliant , Contact

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.

EnggTree.com

Your Success is our Mission

GE3151 Problem Solving and Python Programming Question Bank

GE3151 PSPP Question Bank :

We are providing the GE3151 Problem Solving and Python Programming Question Bank Collections PDF below for your examination success. use our Materials to score good marks in the examination. Best of Luck.

GE3151 Problem Solving and Python Programming Question Bank Download Links :

Ge3151 problem solving and python programming other useful links :, search terms :.

ge3151 program solving and python programming question bank,

ge3151 program solving and python programming question bank pdf,

ge3151 pspp qb,

ge3151 pspp important questions,

ge3151 program solving and python programming important questions,

ge3151 program solving and python programming important questions pdf,

EnggTree Maintained by Karthick Raja

problem solving and python programming important questions

See author's posts

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Related Stories

CS3492 Database Management Systems Two Mark Questions

Cs3491 artificial intelligence and machine learning two mark questions, cs3452 theory of computation two mark questions.

GE8151 Important Questions Problem Solving and Python Programming pspp Regulation 2017 Anna University

GE8151 Important Questions Problem Solving and Python Programming

GE8151 Important Questions Problem Solving and Python Programming pspp Regulation 2017 Anna University pdf free download. Problem Solving and Python Programming pspp Important Questions GE8151  free download.

Sample GE8151 Important Questions Problem Solving and Python Programming pspp

Unit-I GE8151 Important Questions Problem Solving and Python Programming pspp

1. Define an algorithm

2. Distinguish between pseudo code and flowchart

3. Develop algorithm for Celsius to Fahrenheit and vice versa

4. Describe some example for recursion function

5. Describe Iteration

6. Explain problem solving method

Unit II GE8151 Important Questions Problem Solving and Python Programming pspp

1. Give the various data types in Python

2. Discuss the various operators in python

3. Discuss difference between recursive and iterative technique.

4. List the syntax for function call with and without arguments

5. Discuss uses of default arguments in python.

6. Discuss the importance of indentation in python

Unit III GE8151 Important Questions Problem Solving and Python Programming pspp

1. Different ways to manipulate strings in python

2. Write the syntax of if and if-else statements, Boolean operators, loop and while loop.

3. How to access the elements of an array using index?

4. Discuss various methods used on a string

5. Discuss the use of return () statement with a suitable example.

6. What are the advantages and disadvantages of recursion function?

Unit IV GE8151 Important Questions Problem Solving and Python Programming pspp

1. What are the list operations? What are the different ways to create a list?

2. Define Python tuple

3. Define dictionary with an example. What are the properties of dictionary keys?

4. Perform the bubble sort on the elements 23,78,45,8,32,56.

5. Write example on insertion sort.

6. What is the use of all(), any(), cmp() and sorted() in dictionary?

Unit V GE8151 Important Questions Problem Solving and Python Programming pspp

1. Define the access modes. Mention different modes of file opening

2. Explain with example the need for exceptions.

3. Define buffering

4. what are the packages in python

5. Differentiate mutable and immutable

6. Discuss about about namespace and scoping.

GE8151 important questions Problem Solving and Python Programming pspp Click here to download

GE8151 Syllabus Problem Solving and Python Programming pspp

GE8151 Notes  Problem Solving and Python Programming pspp

GE8151 Question Bank Problem Solving and Python Programming pspp

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Current [email protected] *

Leave this field empty

Python Practice Problems: Prepare for Your Next Interview

Python Practice Problems: Get Ready for Your Next Interview

Table of Contents

Problem Description

Problem solution.

Are you a Python developer brushing up on your skills before an interview ? If so, then this tutorial will usher you through a series of Python practice problems meant to simulate common coding test scenarios. After you develop your own solutions, you’ll walk through the Real Python team’s answers so you can optimize your code, impress your interviewer, and land your dream job!

In this tutorial, you’ll learn how to:

This tutorial is aimed at intermediate Python developers. It assumes a basic knowledge of Python and an ability to solve problems in Python. You can get skeleton code with failing unit tests for each of the problems you’ll see in this tutorial by clicking on the link below:

Download the sample code: Click here to get the code you’ll use to work through the Python practice problems in this tutorial.

Each of the problems below shows the file header from this skeleton code describing the problem requirements. So download the code, fire up your favorite editor, and let’s dive into some Python practice problems!

Python Practice Problem 1: Sum of a Range of Integers

Let’s start with a warm-up question. In the first practice problem, you’ll write code to sum a list of integers . Each practice problem includes a problem description. This description is pulled directly from the skeleton files in the repo to make it easier to remember while you’re working on your solution.

You’ll see a solution section for each problem as well. Most of the discussion will be in a collapsed section below that. Clone that repo if you haven’t already, work out a solution to the following problem, then expand the solution box to review your work.

Here’s your first problem:

Sum of Integers Up To n ( integersums.py ) Write a function, add_it_up() , that takes a single integer as input and returns the sum of the integers from zero to the input parameter. The function should return 0 if a non-integer is passed in.

Remember to run the unit tests until you get them passing!

Here’s some discussion of a couple of possible solutions.

Note: Remember, don’t open the collapsed section below until you’re ready to look at the answer for this Python practice problem!

Solution for Sum of a Range of Integers Show/Hide

How did writing the solution go? Ready to look at the answer?

For this problem, you’ll look at a few different solutions. The first of these is not so good:

In this solution, you manually build a while loop to run through the numbers 1 through n . You keep a running sum and then return it when you’ve finished the loop.

This solution works, but it has two problems:

It doesn’t display your knowledge of Python and how the language simplifies tasks like this.

It doesn’t meet the error conditions in the problem description. Passing in a string will result in the function throwing an exception when it should just return 0 .

You’ll deal with the error conditions in the final answer below, but first let’s refine the core solution to be a bit more Pythonic .

The first thing to think about is that while loop . Python has powerful mechanisms for iterating over lists and ranges. Creating your own is usually unnecessary, and that’s certainly the case here. You can replace the while loop with a loop that iterates over a range() :

You can see that the for...range() construct has replaced your while loop and shortened the code. One thing to note is that range() goes up to but does not include the number given, so you need to use n + 1 here.

This was a nice step! It removes some of the boilerplate code of looping over a range and makes your intention clearer. But there’s still more you can do here.

Summing a list of integers is another thing Python is good at:

Wow! By using the built-in sum() , you got this down to one line of code! While code golf generally doesn’t produce the most readable code, in this case you have a win-win: shorter and more readable code.

There’s one problem remaining, however. This code still doesn’t handle the error conditions correctly. To fix that, you can wrap your previous code in a try...except block:

This solves the problem and handles the error conditions correctly. Way to go!

Occasionally, interviewers will ask this question with a fixed limit, something like “Print the sum of the first nine integers.” When the problem is phrased that way, one correct solution would be print(45) .

If you give this answer, however, then you should follow up with code that solves the problem step by step. The trick answer is a good place to start your answer, but it’s not a great place to end.

If you’d like to extend this problem, try adding an optional lower limit to add_it_up() to give it more flexibility!

Python Practice Problem 2: Caesar Cipher

The next question is a two-parter. You’ll code up a function to compute a Caesar cipher on text input. For this problem, you’re free to use any part of the Python standard library to do the transform.

Hint: There’s a function in the str class that will make this task much easier!

The problem statement is at the top of the skeleton source file:

Caesar Cipher ( caesar.py ) A Caesar cipher is a simple substitution cipher in which each letter of the plain text is substituted with a letter found by moving n places down the alphabet. For example, assume the input plain text is the following: abcd xyz If the shift value, n , is 4, then the encrypted text would be the following: efgh bcd You are to write a function that accepts two arguments, a plain-text message and a number of letters to shift in the cipher. The function will return an encrypted string with all letters transformed and all punctuation and whitespace remaining unchanged. Note: You can assume the plain text is all lowercase ASCII except for whitespace and punctuation.

Remember, this part of the question is really about how well you can get around in the standard library. If you find yourself figuring out how to do the transform without the library, then save that thought! You’ll need it later!

Here’s a solution to the Caesar cipher problem described above.

Note: Remember, don’t open the collapsed section below until you’re ready to look at the answers for this Python practice problem!

Solution for Caesar Cipher Show/Hide

This solution makes use of .translate() from the str class in the standard library. If you struggled with this problem, then you might want to pause a moment and consider how you could use .translate() in your solution.

Okay, now that you’re ready, let’s look at this solution:

You can see that the function makes use of three things from the string module:

In the first two lines, you create a variable with all the lowercase letters of the alphabet (ASCII only for this program) and then create a mask , which is the same set of letters, only shifted. The slicing syntax is not always obvious, so let’s walk through it with a real-world example:

You can see that x[3:] is all the letters after the third letter, 'c' , while x[:3] is just the first three letters.

Line 6 in the solution, letters[shift_num:] + letters[:shift_num] , creates a list of letters shifted by shift_num letters, with the letters at the end wrapped around to the front. Once you have the list of letters and the mask of letters you want to map to, you call .maketrans() to create a translation table.

Next, you pass the translation table to the string method .translate() . It maps all characters in letters to the corresponding letters in mask and leaves all other characters alone.

This question is an exercise in knowing and using the standard library. You may be asked a question like this at some point during an interview. If that happens to you, it’s good to spend some time thinking about possible answers. If you can remember the method— .translate() in this case—then you’re all set.

But there are a couple of other scenarios to consider:

You may completely draw a blank. In this case, you’ll probably solve this problem the way you solve the next one , and that’s an acceptable answer.

You may remember that the standard library has a function to do what you want but not remember the details.

If you were doing normal work and hit either of these situations, then you’d just do some searching and be on your way. But in an interview situation, it will help your cause to talk through the problem out loud.

Asking the interviewer for specific help is far better than just ignoring it. Try something like “I think there’s a function that maps one set of characters to another. Can you help me remember what it’s called?”

In an interview situation, it’s often better to admit that you don’t know something than to try to bluff your way through.

Now that you’ve seen a solution using the Python standard library, let’s try the same problem again, but without that help!

Python Practice Problem 3: Caesar Cipher Redux

For the third practice problem, you’ll solve the Caesar cipher again, but this time you’ll do it without using .translate() .

The description of this problem is the same as the previous problem. Before you dive into the solution, you might be wondering why you’re repeating the same exercise, just without the help of .translate() .

That’s a great question. In normal life, when your goal is to get a working, maintainable program, rewriting parts of the standard library is a poor choice. The Python standard library is packed with working, well-tested, and fast solutions for problems large and small. Taking full advantage of it is a mark of a good programmer.

That said, this is not a work project or a program you’re building to satisfy a need. This is a learning exercise, and it’s the type of question that might be asked during an interview. The goal for both is to see how you can solve the problem and what interesting design trade-offs you make while doing it.

So, in the spirit of learning, let’s try to resolve the Caesar cipher without .translate() .

For this problem, you’ll have two different solutions to look at when you’re ready to expand the section below.

Solutions for Caesar Cipher Redux Show/Hide

For this problem, two different solutions are provided. Check out both and see which one you prefer!

For the first solution, you follow the problem description closely, adding an amount to each character and flipping it back to the beginning of the alphabet when it goes on beyond z :

Starting on line 14, you can see that caesar() does a list comprehension , calling a helper function for each letter in message . It then does a .join() to create the new encoded string. This is short and sweet, and you’ll see a similar structure in the second solution. The interesting part happens in shift_n() .

Here you can see another use for string.ascii_lowercase , this time filtering out any letter that isn’t in that group. Once you’re certain you’ve filtered out any non-letters, you can proceed to encoding. In this version of encoding, you use two functions from the Python standard library:

Again, you’re encouraged not only to learn these functions but also to consider how you might respond in an interview situation if you couldn’t remember their names.

ord() does the work of converting a letter to a number, and chr() converts it back to a letter. This is handy as it allows you to do arithmetic on letters, which is what you want for this problem.

The first step of your encoding on line 7 gets the numeric value of the encoded letter by using ord() to get the numeric value of the original letter. ord() returns the Unicode code point of the character, which turns out to be the ASCII value.

For many letters with small shift values, you can convert the letter back to a character and you’ll be done. But consider the starting letter, z .

A shift of one character should result in the letter a . To achieve this wraparound, you find the difference from the encoded letter to the letter z . If that difference is positive, then you need to wrap back to the beginning.

You do this in lines 8 to 11 by repeatedly adding 26 to or subtracting it from the character until it’s in the range of ASCII characters. Note that this is a fairly inefficient method for fixing this issue. You’ll see a better solution in the next answer.

Finally, on line 12, your conversion shift function takes the numeric value of the new letter and converts it back to a letter to return it.

While this solution takes a literal approach to solving the Caesar cipher problem, you could also use a different approach modeled after the .translate() solution in practice problem 2 .

The second solution to this problem mimics the behavior of Python’s built-in method .translate() . Instead of shifting each letter by a given amount, it creates a translation map and uses it to encode each letter:

Starting with caesar() on line 11, you start by fixing the problem of amount being greater than 26 . In the previous solution, you looped repeatedly until the result was in the proper range. Here, you take a more direct and more efficient approach using the mod operator ( % ).

The mod operator produces the remainder from an integer division. In this case, you divide by 26 , which means the results are guaranteed to be between 0 and 25 , inclusive.

Next, you create the translation table. This is a change from the previous solutions and is worth some attention. You’ll see more about this toward the end of this section.

Once you create the table , the rest of caesar() is identical to the previous solution: a list comprehension to encrypt each letter and a .join() to create a string.

shift_n() finds the index of the given letter in the alphabet and then uses this to pull a letter from the table . The try...except block catches those cases that aren’t found in the list of lowercase letters.

Now let’s discuss the table creation issue. For this toy example, it probably doesn’t matter too much, but it illustrates a situation that occurs frequently in everyday development: balancing clarity of code against known performance bottlenecks.

If you examine the code again, you’ll see that table is used only inside shift_n() . This indicates that, in normal circumstances, it should have been created in, and thus have its scope limited to, shift_n() :

The issue with that approach is that it spends time calculating the same table for every letter of the message. For small messages, this time will be negligible, but it might add up for larger messages.

Another possible way that you could avoid this performance penalty would be to make table a global variable. While this also cuts down on the construction penalty, it makes the scope of table even larger. This doesn’t seem better than the approach shown above.

At the end of the day, the choice between creating table once up front and giving it a larger scope or just creating it for every letter is what’s called a design decision . You need to choose the design based on what you know about the actual problem you’re trying to solve.

If this is a small project and you know it will be used to encode large messages, then creating the table only once could be the right decision. If this is only a portion of a larger project, meaning maintainability is key, then perhaps creating the table each time is the better option.

Since you’ve looked at two solutions, it’s worth taking a moment to discuss their similarities and differences.

Solution Comparison

You’ve seen two solutions in this part of the Caesar cipher, and they’re fairly similar in many ways. They’re about the same number of lines. The two main routines are identical except for limiting amount and creating table . It’s only when you look at the two versions of the helper function, shift_n() , that the differences appear.

The first shift_n() is an almost literal translation of what the problem is asking for: “Shift the letter down the alphabet and wrap it around at z .” This clearly maps back to the problem statement, but it has a few drawbacks.

Although it’s about the same length as the second version, the first version of shift_n() is more complex. This complexity comes from the letter conversion and math needed to do the translation. The details involved—converting to numbers, subtracting, and wrapping—mask the operation you’re performing. The second shift_n() is far less involved in its details.

The first version of the function is also specific to solving this particular problem. The second version of shift_n() , like the standard library’s .translate() that it’s modeled after, is more general-purpose and can be used to solve a larger set of problems. Note that this is not necessarily a good design goal.

One of the mantras that came out of the Extreme Programming movement is “You aren’t gonna need it” (YAGNI). Frequently, software developers will look at a function like shift_n() and decide that it would be better and more general-purpose if they made it even more flexible, perhaps by passing in a parameter instead of using string.ascii_lowercase .

While that would indeed make the function more general-purpose, it would also make it more complex. The YAGNI mantra is there to remind you not to add complexity before you have a specific use case for it.

To wrap up your Caesar cipher section, there are clear trade-offs between the two solutions, but the second shift_n() seems like a slightly better and more Pythonic function.

Now that you’ve written the Caesar cipher three different ways, let’s move on to a new problem.

Python Practice Problem 4: Log Parser

The log parser problem is one that occurs frequently in software development. Many systems produce log files during normal operation, and sometimes you’ll need to parse these files to find anomalies or general information about the running system.

For this problem, you’ll need to parse a log file with a specified format and generate a report:

Log Parser ( logparse.py ) Accepts a filename on the command line. The file is a Linux-like log file from a system you are debugging. Mixed in among the various statements are messages indicating the state of the device. They look like this: Jul 11 16:11:51:490 [139681125603136] dut: Device State: ON The device state message has many possible values, but this program cares about only three: ON , OFF , and ERR . Your program will parse the given log file and print out a report giving how long the device was ON and the timestamp of any ERR conditions.

Note that the provided skeleton code doesn’t include unit tests. This was omitted since the exact format of the report is up to you. Think about and write your own during the process.

A test.log file is included, which provides you with an example. The solution you’ll examine produces the following output:

While that format is generated by the Real Python solution, you’re free to design your own format for the output. The sample input file should generate equivalent information.

In the collapsed section below, you’ll find a possible solution to the log parser problem. When you’re ready, expand the box and compare it with what you came up with!

Solution for Log Parser Problem Show/Hide

Full Solution

Since this solution is longer than what you saw for the integer sums or the Caesar cipher problems, let’s start with the full program:

That’s your full solution. You can see that the program consists of three functions and the main section. You’ll work through them from the top.

Helper Function: get_next_event()

First up is get_next_event() :

Because it contains a yield statement, this function is a generator . That means you can use it to generate one event from the log file at a time.

You could have just used for line in datafile , but instead you add a little bit of filtering. The calling routine will get only those events that have dut: Device State: in them. This keeps all the file-specific parsing contained in a single function.

This might make get_next_event() a bit more complicated, but it’s a relatively small function, so it remains short enough to read and comprehend. It also keeps that complicated code encapsulated in a single location.

You might be wondering when datafile gets closed. As long as you call the generator until all of the lines are read from datafile , the for loop will complete, allowing you to leave the with block and exit from the function.

Helper Function: compute_time_diff_seconds()

The second function is compute_time_diff_seconds() , which, as the name suggests, computes the number of seconds between two timestamps:

There are a few interesting points to this function. The first is that subtracting the two datetime objects results in a datetime.timedelta . For this problem, you will report total seconds, so returning .total_seconds() from the timedelta is appropriate.

The second item of note is that there are many, many packages in Python that simplify handling dates and times. In this case, your use model is simple enough that it doesn’t warrant the complexity of pulling in an external library when the standard library functions will suffice.

That said, datetime.datetime.strptime() is worthy of mention. When passed a string and a specific format, .strptime() parses that string with the given format and produces a datetime object.

This is another place where, in an interview situation, it’s important not to panic if you can’t remember the exact names of the Python standard library functions.

Helper Function: extract_data()

Next up is extract_data() , which does the bulk of the work in this program. Before you dive into the code, let’s step back and talk about state machines.

State machines are software (or hardware) devices that transition from one state to another depending on specific inputs. That’s a really broad definition that might be difficult to grasp, so let’s look at a diagram of the state machine you’ll be using below:

State machine with two states: ON and OFF with transitions between the states.

In this diagram, the states are represented by the labeled boxes. There are only two states here, ON and OFF , which correspond to the state of the device. There are also two input signals, Device State: ON and Device State: OFF . The diagram uses arrows to show what happens when an input occurs while the machine is in each state.

For example, if the machine is in the ON state and the Device State: ON input occurs, then the machine stays in the ON state. No change happens. Conversely, if the machine receives the Device State: OFF input when it’s in the ON state, then it will transition to the OFF state.

While the state machine here is only two states with two inputs, state machines are often much more complex. Creating a diagram of expected behavior can help you make the code that implements the state machine more concise.

Let’s move back to extract_data() :

It might be hard to see the state machine here. Usually, state machines require a variable to hold the state. In this case, you use time_on_started to serve two purposes:

The top of extract_data() sets up your state variable, time_on_started , and also the two outputs you want. errs is a list of timestamps at which the ERR message was found, and total_time_on is the sum of all periods when the device was on.

Once you’ve completed the initial setup, you call the get_next_event() generator to retrieve each event and timestamp. The action it receives is used to drive the state machine, but before it checks for state changes, it first uses an if block to filter out any ERR conditions and add those to errs .

After the error check, the first elif block handles transitions to the ON state. You can transition to ON only when you’re in the OFF state, which is signaled by time_on_started being False . If you’re not already in the ON state and the action is "ON" , then you store the timestamp , putting the machine into the ON state.

The second elif handles the transition to the OFF state. On this transition, extract_data() needs to compute the number of seconds the device was on. It does this using the compute_time_diff_seconds() you saw above. It adds this time to the running total_time_on and sets time_on_started back to None , effectively putting the machine back into the OFF state.

Main Function

Finally, you can move on to the __main__ section. This final section passes sys.argv[1] , which is the first command-line argument , to extract_data() and then presents a report of the results:

To call this solution, you run the script and pass the name of the log file. Running your example code results in this output:

Your solution might have different formatting, but the information should be the same for the sample log file.

There are many ways to solve a problem like this. Remember that in an interview situation, talking through the problem and your thought process can be more important than which solution you choose to implement.

That’s it for the log-parsing solution. Let’s move on to the final challenge: sudoku!

Python Practice Problem 5: Sudoku Solver

Your final Python practice problem is to solve a sudoku puzzle!

Finding a fast and memory-efficient solution to this problem can be quite a challenge. The solution you’ll examine has been selected for readability rather than speed, but you’re free to optimize your solution as much as you want.

The description for the sudoku solver is a little more involved than the previous problems:

Sudoku Solver ( sudokusolve.py ) Given a string in SDM format, described below, write a program to find and return the solution for the sudoku puzzle in the string. The solution should be returned in the same SDM format as the input. Some puzzles will not be solvable. In that case, return the string “Unsolvable”. The general SDM format is described here . For our purposes, each SDM string will be a sequence of 81 digits, one for each position on the sudoku puzzle. Known numbers will be given, and unknown positions will have a zero value. For example, assume you’re given this string of digits: 004006079000000602056092300078061030509000406020540890007410920105000000840600100 The string represents this starting sudoku puzzle: 0 0 4 0 0 6 0 7 9 0 0 0 0 0 0 6 0 2 0 5 6 0 9 2 3 0 0 0 7 8 0 6 1 0 3 0 5 0 9 0 0 0 4 0 6 0 2 0 5 4 0 8 9 0 0 0 7 4 1 0 9 2 0 1 0 5 0 0 0 0 0 0 8 4 0 6 0 0 1 0 0 The provided unit tests may take a while to run, so be patient. Note: A description of the sudoku puzzle can be found on Wikipedia .

You can see that you’ll need to deal with reading and writing to a particular format as well as generating a solution.

When you’re ready, you can find a detailed explanation of a solution to the sudoku problem in the box below. A skeleton file with unit tests is provided in the repo.

Solution for Sudoku Solver Show/Hide

This is a larger and more complex problem than you’ve looked at so far in this tutorial. You’ll walk through the problem step by step, ending with a recursive function that solves the puzzle. Here’s a rough outline of the steps you’ll take:

The tricky part of this algorithm is keeping track of the grid at each step of the process. You’ll use recursion, making a new copy of the grid at each level of the recursion, to maintain this information.

With that outline in mind, let’s start with the first step, creating the grid.

Generating a Grid From a Line

To start, it’s helpful to convert the puzzle data into a more usable format. Even if you eventually want to solve the puzzle in the given SDM format , you’ll likely make faster progress working through the details of your algorithm with the data in a grid form. Once you have a solution that works, then you can convert it to work on a different data structure.

To this end, let’s start with a couple of conversion functions:

Your first function, line_to_grid() , converts the data from a single string of eighty-one digits to a list of lists. For example, it converts the string line to a grid like start :

Each inner list here represents a horizontal row in your sudoku puzzle.

You start with an empty grid and an empty line . You then build each line by converting nine characters from the values string to single-digit integers and then appending them to the current line . Once you have nine values in a line , as indicated by index % 9 == 0 on line 7, you insert that line into the grid and start a new one.

The function ends by appending the final line to the grid . You need this because the for loop will end with the last line still stored in the local variable and not yet appended to grid .

The inverse function, grid_to_line() , is slightly shorter. It uses a generator expression with .join() to create a nine-digit string for each row. It then appends that string to the overall line and returns it. Note that it’s possible to use nested generators to create this result in fewer lines of code, but the readability of the solution starts to fall off dramatically.

Now that you’ve got the data in the data structure you want, let’s start working with it.

Generating a Small Square Iterator

Your next function is a generator that will help you search for the smaller three-by-three square a given position is in. Given the x- and y-coordinates of the cell in question, this generator will produce a list of coordinates that match the square that contains it:

A Sudoku grid with one of the small squares highlighted.

In the image above, you’re examining cell (3, 1) , so your generator will produce coordinate pairs corresponding to all the lightly shaded cells, skipping the coordinates that were passed in:

Putting the logic for determining this small square in a separate utility function keeps the flow of your other functions more readable. Making this a generator allows you to use it in a for loop to iterate through each of the values.

The function to do this involves using the limitations of integer math:

There are a lot of threes in a couple of those lines, which makes lines like ((x + 3) // 3) * 3 look confusing. Here’s what happens when x is 1 .

Using the rounding of integer math allows you to get the next-highest multiple of three above a given value. Once you have this, subtracting three will give you the multiple of three below the given number.

There are a few more low-level utility functions to examine before you start building on top of them.

Moving to the Next Spot

Your solution will need to walk through the grid structure one cell at a time. This means that at some point, you’ll need to figure out what the next position should be. compute_next_position() to the rescue!

compute_next_position() takes the current x- and y-coordinates as input and returns a tuple containing a finished flag along with the x- and y-coordinates of the next position:

The finished flag tells the caller that the algorithm has walked off the end of the puzzle and has completed all the squares. You’ll see how that’s used in a later section.

Removing Impossible Numbers

Your final low-level utility is quite small. It takes an integer value and an iterable. If the value is nonzero and appears in the iterable, then the function removes it from the iterable:

Typically, you wouldn’t make this small bit of functionality into a function. You’ll use this function several times, though, so it’s best to follow the DRY principle and pull it up to a function.

Now you’ve seen the bottom level of the functionality pyramid. It’s time to step up and use those tools to build a more complex function. You’re almost ready to solve the puzzle!

Finding What’s Possible

Your next function makes use of some of the low-level functions you’ve just walked through. Given a grid and a position on that grid, it determines what values that position could still have:

A Sudoku grid showing a starting point to indicate possible values for a specific cell.

For the grid above, at the position (3, 1) , the possible values are [1, 5, 8] because the other values are all present, either in that row or column or in the small square you looked at earlier.

This is the responsibility of detect_possible() :

The function starts by checking if the given position at x and y already has a nonzero value. If so, then that’s the only possible value and it returns.

If not, then the function creates a set of the numbers one through nine. The function proceeds to check different blocking numbers and removes those from this set.

It starts by checking the column and row of the given position. This can be done with a single loop by just alternating which subscript changes. grid[x][index] checks values in the same column, while grid[index][y] checks those values in the same row. You can see that you’re using test_and_remove() here to simplify the code.

Once those values have been removed from your possible set, the function moves on to the small square. This is where the small_square() generator you created before comes in handy. You can use it to iterate over each position in the small square, again using test_and_remove() to eliminate any known values from your possible list.

Once all the known blocking values have been removed from your set, you have the list of all possible values for that position on that grid.

You might wonder why the code and its description make a point about the position being “on that grid.” In your next function, you’ll see that the program makes many copies of the grid as it tries to solve it.

You’ve reached the heart of this solution: solve() ! This function is recursive, so a little up-front explanation might help.

The general design of solve() is based on testing a single position at a time. For the position of interest, the algorithm gets the list of possible values and then selects those values, one at a time, to be in this position.

For each of these values, it creates a grid with the guessed value in this position. It then calls a function to test for a solution, passing in the new grid and the next position.

It just so happens that the function it calls is itself.

For any recursion, you need a termination condition. This algorithm has four of them:

Let’s look at the code for this and see how it all plays out:

The first thing to note in this function is that it makes a .deepcopy() of the grid. It does a deep copy because the algorithm needs to keep track of exactly where it was at any point in the recursion. If the function made only a shallow copy, then every recursive version of this function would use the same grid.

Once the grid is copied, solve() can work with the new copy, temp . A position on the grid was passed in, so that’s the number that this version of the function will solve. The first step is to see what values are possible in this position. As you saw earlier, detect_possible() returns a list of possible values that may be empty.

If there are no possible values, then you’ve hit the first termination condition for the recursion. The function returns False , and the calling routine moves on.

If there are possible values, then you need to move on and see if any of them is a solution. Before you do that, you can add a little optimization to the code. If there’s only a single possible value, then you can insert that value and move on to the next position. The solution shown does this in a loop, so you can place multiple numbers into the grid without having to recur.

This may seem like a small improvement, and I’ll admit my first implementation did not include this. But some testing showed that this solution was dramatically faster than simply recurring here at the price of more complex code.

Note: This is an excellent point to bring up during an interview even if you don’t add the code to do this. Showing them that you’re thinking about trading off speed against complexity is a strong positive signal to interviewers.

Sometimes, of course, there will be multiple possible values for the current position, and you’ll need to decide if any of them will lead to a solution. Fortunately, you’ve already determined the next position in the grid, so you can forgo placing the possible values.

If the next position is off the end of the grid, then the current position is the final one to fill. If you know that there’s at least one possible value for this position, then you’ve found a solution! The current position is filled in and the completed grid is returned up to the calling function.

If the next position is still on the grid, then you loop through each possible value for the current spot, filling in the guess at the current position and then calling solve() with the temp grid and the new position to test.

solve() can return only a completed grid or False , so if any of the possible guesses returns a result that isn’t False , then a result has been found, and that grid can be returned up the stack.

If all possible guesses have been made and none of them is a solution, then the grid that was passed in is unsolvable. If this is the top-level call, then that means the puzzle is unsolvable. If the call is lower in the recursion tree, then it just means that this branch of the recursion tree isn’t viable.

Putting It All Together

At this point, you’re almost through the solution. There’s only one final function left, sudoku_solve() :

This function does three things:

That’s it! You’ve walked through a solution for the sudoku solver problem.

Interview Discussion Topics

The sudoku solver solution you just walked through is a good deal of code for an interview situation. Part of an interview process would likely be to discuss some of the code and, more importantly, some of the design trade-offs you made. Let’s look at a few of those trade-offs.

The biggest design decision revolves around using recursion. It’s possible to write a non-recursive solution to any problem that has a recursive solution. Why choose recursion over another option?

This is a discussion that depends not only on the problem but also on the developers involved in writing and maintaining the solution. Some problems lend themselves to rather clean recursive solutions, and some don’t.

In general, recursive solutions will take more time to run and use more memory than non-recursive solutions. But that’s not always true and, more importantly, it’s not always important .

Similarly, some teams of developers are comfortable with recursive solutions, while others find them exotic or unnecessarily complex. Maintainability should play into your design decisions as well.

One good discussion to have about a decision like this is around performance. How fast does this solution need to execute? Will it be used to solve billions of puzzles or just a handful? Will it run on a small embedded system with memory constraints, or will it be on a large server?

These external factors can help you decide which is a better design decision. These are great topics to bring up in an interview as you’re working through a problem or discussing code. A single product might have places where performance is critical (doing ray tracing on a graphics algorithm, for example) and places where it doesn’t matter at all (such as parsing the version number during installation).

Bringing up topics like this during an interview shows that you’re not only thinking about solving an abstract problem, but you’re also willing and able to take it to the next level and solve a specific problem facing the team.

Readability and Maintainability

Sometimes it’s worth picking a solution that’s slower in order to make a solution that’s easier to work with, debug, and extend. The decision in the sudoku solver challenge to convert the data structure to a grid is one of those decisions.

That design decision likely slows down the program, but unless you’ve measured, you don’t know. Even if it does, putting the data structure into a form that’s natural for the problem can make the code easier to comprehend.

It’s entirely possible to write a solver that operates on the linear strings you’re given as input. It’s likely faster and probably takes less memory, but small_square() , among others, will be a lot harder to write, read, and maintain in this version.

Another thing to discuss with an interviewer, whether you’re live coding or discussing code you wrote offline, is the mistakes and false turns you took along the way.

This is a little less obvious and can be slightly detrimental, but particularly if you’re live coding, taking a step to refactor code that isn’t right or could be better can show how you work. Few developers can write perfect code the first time. Heck, few developers can write good code the first time.

Good developers write the code, then go back and refactor it and fix it. For example, my first implementation of detect_possible() looked like this:

Ignoring that it doesn’t consider the small_square() information, this code can be improved. If you compare this to the final version of detect_possible() above, you’ll see that the final version uses a single loop to test both the horizontal and the vertical dimensions.

Wrapping Up

That’s your tour through a sudoku solver solution. There’s more information available on formats for storing puzzles and a huge list of sudoku puzzles you can test your algorithm on.

That’s the end of your Python practice problems adventure! But if you’d like more, head on over to the video course Write and Test a Python Function: Interview Practice to see an experienced developer tackle an interview problem in real time.

Congratulations on working through this set of Python practice problems! You’ve gotten some practice applying your Python skills and also spent some time thinking about how you can respond in different interviewing situations.

In this tutorial, you learned how to:

Remember, you can download the skeleton code for these problems by clicking on the link below:

Feel free to reach out in the comments section with any questions you have or suggestions for other Python practice problems you’d like to see! Also check out our “Ace Your Python Coding Interview” Learning Path to get more resources and for boosting your Python interview skills.

Good luck with the interview!

🐍 Python Tricks 💌

Get a short & sweet Python Trick delivered to your inbox every couple of days. No spam ever. Unsubscribe any time. Curated by the Real Python team.

Python Tricks Dictionary Merge

About Jim Anderson

Jim Anderson

Jim has been programming for a long time in a variety of languages. He has worked on embedded systems, built distributed build systems, done off-shore vendor management, and sat in many, many meetings.

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Aldren Santos

Master Real-World Python Skills With Unlimited Access to Real Python

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

What Do You Think?

What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment below and let us know.

Commenting Tips: The most useful comments are those written with the goal of learning from or helping out other students. Get tips for asking good questions and get answers to common questions in our support portal . Looking for a real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session . Happy Pythoning!

Keep Learning

Related Tutorial Categories: best-practices intermediate

Keep reading Real Python by creating a free account or signing in:

Already have an account? Sign-In

Almost there! Complete this form and click the button below to gain instant access:

Python Practice Problems Sample Code

🔒 No spam. We take your privacy seriously.

problem solving and python programming important questions

Academia.edu no longer supports Internet Explorer.

To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to  upgrade your browser .

Enter the email address you signed up with and we'll email you a reset link.

paper cover thumbnail

GE3151 Python Question Bank

Profile image of Menaga D.

Flowchart Pseudocode  A flowchart is a diagram showing an overview of the problem.  It is a pictorial representation of how the program will work, and it follows a standard format.  It uses different kinds of shapes to signify different processes involved in the problem  Pseudocode is a means of expressing the stepwise instructions for solving a problem without worrying about the syntax of a particular programming language.  Unlike a flowchart, it uses a written format which requires no absolute rules for writing.  It can be written in ordinary English, and we can use some keywords in it too.

Related Papers

MohammadReza Koopaei

problem solving and python programming important questions

Catherine Letondal

Isromi Janwar

Pravesh Kumar

Jose Luis Garavito Alejos

Luis Guzman

Ahsan uzZaman

JAY- MELT Official

Loading Preview

Sorry, preview is currently unavailable. You can download the paper by clicking the button above.

RELATED PAPERS

Lubna Tanweer

GERMAIN NICOLAS MORALES SUAREZ

Srijeet Saha

Stup consultant Pvt. Ltd.

Jose E Vergara L

Manjunath R

Mohiuddin Mahbub

Özlem Ekici

Sergi Simon

University Question Papers

Sunday, February 7, 2021

Anna university ge 8151 - problem solving and python programming,november december 2019 question paper.

Anna University Previous Years Old Question Papers

Question Paper Code:90277

B.E / B.Tech Degree Examinations,November December 2019

First Semester

Civil Engineering

GE 8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING

(Common to all branches

(Regulation 2017)

Time: Three hours

Maximum: 100 marks

Attachment Type: PDF and Images

PDF Download:  Click Here to Anna UniversityGE 8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING,November December 2019 Question Paper

Question Paper Scanned Images Download: 

problem solving and python programming important questions

Little star

B.E Civil Engineer Graduated from Government College of Engineering Tirunelveli in the year 2016. She has developed this website for the welfare of students community not only for students under Anna University Chennai, but for all universities located in India. That's why her website is named as www.IndianUniversityQuestionPapers.com . If you don't find any study materials that you are looking for, you may intimate her through contact page of this website to know her so that it will be useful for providing them as early as possible. You can also share your own study materials and it can be published in this website after verification and reviewing. Thank you!

0 comments:

Pen down your valuable important comments below

Search Everything Here

Ezoic

Send Question Papers and Get Paid. Click Here to send QP by whatsapp

Sponsored link, popular posts.

Osmania University B.Com / BA / B.Sc 1st Sem General English Paper-I Nov Dec 2020 Question Paper

MGU B.Com C01CMT01 Banking and Insurance Dec 2018 Question Paper

Free E-Mail Alert for Latest Exam Papers

Free E-Mail Alert for Latest Exam Papers

Join Us on Facebook / Google Plus

Subscribe free updates on your email | rss.

Blog Archive

Problem Solving, Python Programming, and Video Games

Image of instructor, Duane Szafron

About this Course

This course is an introduction to computer science and programming in Python. Upon successful completion of this course, you will be able to:

1. Take a new computational problem and solve it, using several problem solving techniques including abstraction and problem decomposition. 2. Follow a design creation process that includes: descriptions, test plans, and algorithms. 3. Code, test, and debug a program in Python, based on your design. Important computer science concepts such as problem solving (computational thinking), problem decomposition, algorithms, abstraction, and software quality are emphasized throughout. This course uses problem-based learning. The Python programming language and video games are used to demonstrate computer science concepts in a concrete and fun manner. The instructional videos present Python using a conceptual framework that can be used to understand any programming language. This framework is based on several general programming language concepts that you will learn during the course including: lexics, syntax, and semantics. Other approaches to programming may be quicker, but are more focused on a single programming language, or on a few of the simplest aspects of programming languages. The approach used in this course may take more time, but you will gain a deeper understanding of programming languages. After completing the course, in addition to learning Python programming, you will be able to apply the knowledge and skills you acquired to: non-game problems, other programming languages, and other computer science courses. You do not need any previous programming, Python, or video game experience. However, several basic skills are needed: computer use (e.g., mouse, keyboard, document editing), elementary mathematics, attention to detail (as with many technical subjects), and a “just give it a try” spirit will be keys to your success. Despite the use of video games for the main programming project, PVG is not about computer games. For each new programming concept, PVG uses non-game examples to provide a basic understanding of computational principles, before applying these programming concepts to video games. The interactive learning objects (ILO) of the course provide automatic, context-specific guidance and feedback, like a virtual teaching assistant, as you develop problem descriptions, functional test plans, and algorithms. The course forums are supported by knowledgeable University of Alberta personnel, to help you succeed. All videos, assessments, and ILOs are available free of charge. There is an optional Coursera certificate available for a fee.

Could your company benefit from training employees on in-demand skills?

Skills you will gain

Instructors

Placeholder

Duane Szafron

Placeholder

University of Alberta

UAlberta is considered among the world’s leading public research- and teaching-intensive universities. As one of Canada’s top universities, we’re known for excellence across the humanities, sciences, creative arts, business, engineering and health sciences.

See how employees at top companies are mastering in-demand skills

Syllabus - What you will learn from this course

Module 0: introduction.

In Module 0, you will meet the instructional team and be introduced to the four themes of this course: computer science, problem solving, Python programming, and how to create video games.

Module 1: Design Hacking Version 1

In Module 1, you will explore the game creation process that is used in this course. You will use this process to design Version 1 of the first game, Hacking. You will use two problem-solving techniques: problem decomposition and algorithms. You will explore five criteria for problem decomposition: experiential decomposition, feature selection, problem refinement, spatial decomposition, and temporal decomposition. To create your design for Hacking Version 1, you will use three interactive learning objects: the description builder, functional test plan builder, and algorithm builder.

Module 2: Program Hacking Version 1

In Module 2, you will discover how lexics, syntax, and semantics can be used to understand and describe programming languages. You will use these concepts to understand your first Python statement (expression statement), first three Python expressions (literal, identifier, function call), and first five Python types (int, str, float, function, NoneType). You will use these Python constructs to write, test, and debug Hacking Version 1, a text-based game version. You will then reflect on your game version by using a third problem-solving technique called abstraction, including the specific technique of solution generalization, to solve similar problems.

Module 3: Hacking Version 2

In Module 3, you will identify solution issues in your game. You will apply a second form of the abstraction problem-solving technique, called using templates, to solve a solution issue by using a graphics library. You will then use lexics, syntax, and semantics to learn two new Python statements (assignment, import), two new Python expressions (binary expression, attribute reference), and one new Python type (module). You will employ these Python constructs and a simple graphics library to write, test, and debug Hacking Version 2.

Module 4: Hacking Version 3

In Module 4, you will modify your game design to support multiple gameplay paths using a new problem decomposition criteria called case-based decomposition, which utilizes a selection control structure. You will learn one new Python statement (if), one new Python expression (unary expression), and one new Python type (bool). You will employ these Python constructs to write, test, and debug Hacking Version 3.

Module 5: Hacking Version 4 & 5

In Module 5, you will modify your game design using two new abstraction techniques, called control abstraction and data abstraction. You will explore two different control abstractions, called definite and indefinite repetition. You will learn two new Python statements (for, while), four new Python expressions (subscription expression, expression list, parenthesized expression, list display), and three new Python types (tuple, list, range). You will employ these Python constructs to write, test, and debug Hacking Version 4 and Hacking Version 5.

Module 6: Hacking Version 6

In Module 6, you will learn a new control abstraction called a user-defined function. You will learn how to implement user-defined functions using two new Python statements (function definition, return). You will employ these Python constructs to significantly improve the quality of your code in Hacking Version 6.

Module 7: Hacking Version 7

In Module 7, you will not learn any new problem-solving techniques or Python language features. Instead you will exercise your problem-solving skills and practice the language constructs you already know to improve your proficiency. You will add some fun features to the Hacking game by designing, coding, testing, and debugging Hacking Version 7.

Module 8: Poke the Dots Version 1 & 2

In Module 8, you will design and implement Version 1 of a new graphical game called Poke the Dots. You will then modify your game design using data abstraction to create user-defined classes. You will learn two new Python statements (class definition, pass) that will allow you to construct your own Python types. You will employ these Python constructs to implement Poke the Dots Version 2.

Module 9: Poke the Dots Version 3

In Module 9, you will not learn any new problem-solving techniques or Python language features. Instead you will exercise your problem-solving skills and practice the language constructs you already know to improve your proficiency. You will add some fun features to the Poke the Dots game by designing, coding, testing, and debugging Poke the Dots Version 3.

Module 10: Poke the Dots Version 4

In Module 10, you will modify your game design using a new form of control abstraction called user-defined methods. User-defined methods allow you to restrict access to the attributes of a class to improve data abstraction. You will employ user-defined methods to implement Poke the Dots Version 4.

Module 11: Poke the Dots Version 5

In Module 11, you will not learn any new problem-solving techniques or Python language features. Instead you will exercise your problem-solving skills and practice the language constructs you already know to improve your proficiency. You will add some fun features to the Poke the Dots game by designing, coding, testing, and debugging Poke the Dots Version 5.

TOP REVIEWS FROM PROBLEM SOLVING, PYTHON PROGRAMMING, AND VIDEO GAMES

excellent course. The syntax analysis was rather hard at times but it gave a more systematic approach to programming. What gained over programming skills is actually efficiency in programming.

I have learnt a lot from this course and it is what i need as well. I do really appreciate that you guys allow me to have this course thank you so much.

As a postgraduate student, I find this course very interesting. I like their way of conveying. Thank you coursera.

Great course! However, not sure all the lexical stuff helped me doing the actual code writing, at least for me.

Frequently Asked Questions

When will I have access to the lectures and assignments?

Access to lectures and assignments depends on your type of enrollment. If you take a course in audit mode, you will be able to see most course materials for free. To access graded assignments and to earn a Certificate, you will need to purchase the Certificate experience, during or after your audit. If you don't see the audit option:

The course may not offer an audit option. You can try a Free Trial instead, or apply for Financial Aid.

The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.

What will I get if I purchase the Certificate?

When you purchase a Certificate you get access to all course materials, including graded assignments. Upon completing the course, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile. If you only want to read and view the course content, you can audit the course for free.

What is the refund policy?

You will be eligible for a full refund until two weeks after your payment date, or (for courses that have just launched) until two weeks after the first session of the course begins, whichever is later. You cannot receive a refund once you’ve earned a Course Certificate, even if you complete the course within the two-week refund period. See our full refund policy .

Is financial aid available?

Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.

What resources can I access if I take this course for free?

All learners can access all the videos, assessments, interactive learning objects (ILO), virtual machine (VM) image, and forums for free.

Can I take this course for university credit?

No. Unfortunately, the PVG course does not qualify for credit at the University of Alberta.

More questions? Visit the Learner Help Center .

Build employee skills, drive business results

Coursera Footer

Learn something new.

Popular Data Science Courses

Popular Computer Science & IT Courses

Popular Business Courses

Placeholder

Problem Solving with Python

If you like this book, please consider purchasing a hard copy version on amazon.com .

If you find the text useful, please consider supporting the work by purchasing a hard copy of the text .

This work is licensed under a GNU General Public License v3.0

problem solving and python programming important questions

Programming requires multiple steps, from understanding the problem, designing a solution, coding, testing and debugging it into a running and correct program. Moreover, this program should be easy to understand and consequently modify. Balancing all of these concerns is a challenge for novice programmers. In this course, we will learn to solve programming problems in a methodical and thoughtful manner using the Python language. We will do so by applying a specific model for programming problem solving and tackling real problems. The course requires a background in programming, at least one introductory course.

Please read this if you wonder whether you should take this course or not.

Instructors

Time and place

Campus 3 - Griebnitzsee ( map )

Announcements

Fifthteenth week, february 4.

Fourteenth Week, January 28

Twelfth Week, January 14

Eleventh Week, January 7

Tenth Week, December 17

Eighth Week, December 3

Seventh Week, November 28

Sixth Week, November 19

Fifth Week, November 12

Fourth Week, November 5

Third Week, October 29

Second Week, October 22

First Week, October 15

First class

Schedule is subject to change

Algorithmic problem solving in python

An algorithm should be defined clearly. An algorithm should produce at least one output. An algorithm should have zero or more inputs. An

Solve algebra

What customers say

This app has really helped with my tertiary studies enabling me to check through problems and help understand how the workings are done, gear app to make math a little more easier, this hlp me a lot in solving my maths problem.

This is app is absolutely amazing! At first i was testing it out to see if it really was giving you the correct answers, but after a few tries it worked like a charm. This app has helped me significantly with schoolwork. Especially if you have trouble with math it gives you step by step examples of how to solve so you can learn on the fly.

Check your internet and scan the problem again. THIS WORKS GREAT, really it helped me a lot, its great it helps me get all the answers i need totally woth it and it has letters that you can use as variables totaly worth it. App is great it works really well, it helps me with most of my problems, there's times it doesn't have the right method I need but they usually have it over time.

How to Use Algorithms to Solve Problems?

10 algorithms to solve before your python coding interview.

Bit Manipulation Problems7 lectures 30min Binary representation of numbers. 03:10 Logical operators. 07:03 Binary shift operators. 03:27 Finding the bit

Algorithmic Problem Solving with Python

A warm-up algorithm, that will help you practicing your slicing skills. In effect the only tricky bit is to make sure you are taking into

Get math assistance online

We offer the fastest, most expert tutoring in the business.

Clear up math questions

If you're looking for expert advice, you've come to the right place! Our experts are available to answer your questions in real-time.

Decide mathematic problems

Math can be confusing, but there are ways to make it easier. One way is to clear up the equations.

Deal with mathematic questions

Math is often viewed as a difficult and boring subject, however, with a little effort it can be easy and interesting.

Problem Solving with Algorithms and Data Structures

An interactive version of Problem Solving with Algorithms and Data Structures using Python.

Experts will give you an answer in real-time

Get help with math online from experts who can show you how to solve even the most difficult problems.

Get calculation assistance online

If you're struggling with math, don't give up! There are plenty of resources available to help you cleared up any questions you may have.

GET SERVICE INSTANTLY

No need to be a math genius, our online calculator can do the work for you.

Recursion, Backtracking and Dynamic Programming in Python

Algorithmic problem solving with python

Apps can be a great way to help students with their algebra. Let's try the best Algorithmic problem solving with python.

Built in features like the camera and easy to understand buttons make life for me, being a mathematics student so much easier, oh mighty This app, take my offering of 5 stars, it was very accurate information and is very helpful I LOVE IT. Very helpful ♥️ I highly recommend this app, especially if you're having trouble in math.
The calculator is very easy to use, and the camera feature works great. I recommend. I've been doing college precalculus and it's been such a pain. This app is really helpful when doing homework or classwork and is really good too. And if I don't know how to do it and need help, this app very useful for my maths doubt Thank u math app Love this app very much and due to this app I got good marks in maths Thank u so much math app 🤗 But only one problem is that that it shows only one time when u download this app it shows steps but after 1 sum they don't give steps it's the most problem But still it's good I like it.
Even fairly accurate with slopy handwriting. This app is very awesome; with This app one can solve and calculate any mathematics problem, for someone that needs to understand how to get to a result, it's perfect. Speaking from personal experience of mine as I used This app during my senior year of high school specifically for Pre Calculus.

Problem Solving with Algorithms and Data Structures Using

Algorithmic Problem Solving with Python programming or algorithmic design, Python's syntax and idioms are much easier to learn than.

Solve homework

If you're struggling to solve your homework, try asking a friend for help.

Timely Delivery

Homework is a necessary part of school that helps students review and practice what they have learned in class.

Provide multiple methods

Timely delivery is important for many businesses and organizations.

Algorithmic Problem Solving with Python

Do mathematic

Coding O'Clock

Search this blog, week 8 programming assignment : problem solving through programming in c 2023, what is problem solving through programming in c, problem-solving through programming in c is a course of action where the students learn to apply the concepts of programming to solve problems that can be formulated as algorithms. the course primarily focuses on using the programming language c to develop algorithms and solve problems. the process involves identifying the problem, breaking it down into smaller sub-problems, and designing an algorithm to solve each of them. the algorithm is then translated into a program written in c, which can be executed to obtain the desired results. the course typically covers the basic concepts of programming in c, such as variables, data types, operators, conditional statements, loops, functions, arrays, and pointers. students learn how to use these concepts to solve problems such as sorting, searching, mathematical operations, string manipulation, and data structures. they also learn about algorithmic complexity and how to measure the efficiency of their programs. problem-solving through programming in c is a crucial skill for anyone who wants to pursue a career in computer science or related fields. it helps students develop their analytical and logical thinking skills, which are essential for solving complex problems. it also provides a foundation for learning other programming languages and concepts. this approach can be used to solve a wide range of problems, from simple arithmetic calculations to complex algorithms and data structures. the key to success in problem-solving through programming in c is to have a strong understanding of the language, good coding practices, and the ability to think logically and creatively to solve problems., week 8: programming assignment 1.

Write a C Program to find HCF of 4 given numbers using recursive function.

Week 8: Programming Assignment 2

Week-08 programming assignment 3, week 8: programming assignment 4.

Write a C program to print a triangle of prime numbers upto given number of lines of the triangle. e.g If number of lines is 3 the triangle will be  2 3      5       7      11      13    

CRITERIA TO GET A CERTIFICATE

Average assignment score = 25% of the average of the best 8 assignments out of the total 12 assignments given in the course. Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE AVERAGE ASSIGNMENT SCORE >=10/25 AND THE EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

Post a Comment

Popular posts from this blog, week 3 programming assignment : programming in modern c++ 2023, week 4 programming assignment : the joy of computing using python 2023, week 2 programming assignment : programming in modern c++ 2023, week 1 programming assignment : programming in modern c++ 2023, week 6 programming assignment : programming in modern c++ 2023, week 6 programming assignment : the joy of computing using python 2023, week 2 programming assignment : programming in java 2023.

NPTEL Problem Solving Through Programming In C Assignment 8 Answers 2023

Hello Learners, In this Post, you will find NPTEL Problem Solving Through Programming In C Assignment 8 Week 8 Answers 2023 . All the Answers are provided below to help the students as a reference don’t straight away look for the solutions.

Please enable JavaScript

NPTEL Problem Solving Through Programming In C Assignment 9 Answers Join Group👇

Note: First try to solve the questions by yourself. If you find any difficulty, then look for the solutions.

NPTEL Problem Solving Through Programming In C Assignment 8 Answers 2023:

Q.1. what is the purpose of the return statement in a function in c, q.2. what is a function prototype in c, q.3. what is the difference between a function declaration and a function definition in c, nptel problem solving through programming in c assignment 8 answers join group👇, q.4. a function prototype is used for, q.5. what is the scope of a variable declared inside a function in c, q.6. what is the output of following c program, q.7. what is the output of the following code snippet, nptel problem solving through programming in c week 8 answers join group👇, q.8. what is the error in the following program, q.9. what is the output of the following, q.10. consider the function.

Disclaimer : This answer is provided by us only for discussion purpose if any answer will be getting wrong don’t blame us. If any doubt or suggestions regarding any question kindly comment. The solution is provided by  Brokenprogrammers . This tutorial is only for Discussion and Learning purpose.

About NPTEL Problem Solving Through Programming In C Course:

Course layout:, criteria to get a certificate :.

If you have not registered for exam kindly register Through https://examform.nptel.ac.in/

Leave a Comment Cancel reply

IMAGES

  1. GE8151: Problem Solving and Python Programming Question Papers

    problem solving and python programming important questions

  2. Problem Solving and Python Programming (Anna Univ)

    problem solving and python programming important questions

  3. Buy Python Programming : Using Problem Solving Approach book : Reema Thareja , 0199480176

    problem solving and python programming important questions

  4. GE8151: Problem Solving and Python Programming Question Papers

    problem solving and python programming important questions

  5. Problem Solving and Python Programming

    problem solving and python programming important questions

  6. GE8151 Problem Solving and Python Programming Jan 2018 Anna University Question Paper

    problem solving and python programming important questions

VIDEO

  1. Solving python problems

  2. Python rule

  3. Python programming Important question |B-tech second year

  4. Send email using Python Programming

  5. PYTHON PROGRAMMING important questions

  6. Python Puzzlers: A Brain Teaser Quiz to Boost Your Coding Skills #python

COMMENTS

  1. Python Exercises, Practice Questions and Solutions

    This Python exercise helps you learn Python using sets of detailed programming Questions from basic to advance. It covers questions on core Python concepts as well as applications of Python on various domains. Python List Exercises Python program to interchange first and last elements in a list Python program to swap two elements in a list

  2. Python Practice Problems for Beginner Coders

    Consider the following questions to make sure you have the proper prior knowledge and coding environment to continue. How much Python do I need to already know? This problem set is intended for people who already have familiarity with Python (or another language) and data types.

  3. Solve Python

    Join over 16 million developers in solving code challenges on HackerRank, one of the best ways to prepare for programming interviews.

  4. Python Exercises, Practice, Challenges

    All exercises are tested on Python 3. Each exercise has 10-20 Questions. The solution is provided for every question. Practice each Exercise in Online Code Editor; These Python programming exercises are suitable for all Python developers. If you are a beginner, you will have a better understanding of Python after solving these exercises.

  5. Best Way to Solve Python Coding Questions

    Python Coding Question We need to write a function that takes a single integer value as input, and returns the sum of the integers from zero up to and including that input. The function should return 0 if a non-integer value is passed in.

  6. [PDF] GE8151 Problem Solving and Python Programming ...

    Important Questions GE8151 Problem Solving and Python Programming (PSPP) Important Questions Important Questions Collection 1 - DOWNLOAD Important Questions Collection 2 - DOWNLOAD Question Papers GE8151 Problem Solving and Python Programming (PSPP) Question Papers Collections Last 5 Years Anna University Question Papers Collection - DOWNLOAD

  7. Top Python Interview Questions and Answers (2022)

    We have prepared a list of Top 40 Python Interview Questions along with their Answers. 1. What is Python? List some popular applications of Python in the world of technology? Python is a widely-used general-purpose, high-level programming language. It was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation.

  8. [PDF] GE3151 Problem Solving and Python Programming (PSPP) Books

    Download GE3151 Problem Solving and Python Programming (PSPP) Books Lecture Notes Syllabus Part-A 2 marks with answers GE3151 Problem Solving and Python Programming Important Part-B 16 marks Questions, PDF Books, Question Bank with answers Key, GE3151 Problem Solving and Python Programming Syllabus & Anna University GE3151 Problem Solving and …

  9. Problem Solving and Python Programming

    Python Algorithmic Problem Solving: short important questions and answers Python Algorithmic Problem Solving: brief important questions and answers UNIT II: DATA TYPES, EXPRESSIONS, STATEMENTS Introduction to Python Python interpreter Modes of Python Interpreter Values and Data Types Variables - Python Keywords - Python Identifiers - Python

  10. GE3151 Problem Solving and Python Programming Question Bank

    GE3151 PSPP Question Bank : We are providing the GE3151 Problem Solving and Python Programming Question Bank Collections PDF below for your examination success. use our Materials to score good marks in the examination. Best of Luck. Regulation. 2021. Subject Code. GE3151. Subject Name.

  11. GE8151 Important Questions Problem Solving and Python Programming

    Unit-I GE8151 Important Questions Problem Solving and Python Programming pspp 1. Define an algorithm 2. Distinguish between pseudo code and flowchart 3. Develop algorithm for Celsius to Fahrenheit and vice versa 4. Describe some example for recursion function 5. Describe Iteration 6. Explain problem solving method

  12. Problem Solving And Python Programming Important Questions Anna

    Problem Solving And Python Programming Important Questions Anna University | Tamil Terrace Out 36.2K subscribers Join Subscribe 548 Share Save 14K views 9 months ago #Tamil #ImportantQuestions...

  13. Python Practice Problems: Get Ready for Your Next Interview

    While this solution takes a literal approach to solving the Caesar cipher problem, you could also use a different approach modeled after the .translate() solution in practice problem 2. Solution 2. The second solution to this problem mimics the behavior of Python's built-in method .translate(). Instead of shifting each letter by a given ...

  14. GE 3151 Important Questions

    2021 Regulation GE 3151 Problem Solving & Python Programming PPSP subject important questions with notes Anna University latest newsFor Notes & Materials Tel...

  15. 49 Python Interview Questions To Prepare for in 2023

    If you are already proficient with the language, find some practice interview questions online. Many of these questions will quiz you on your vocabulary, level of fluency and problem-solving skills. Regardless of your level of expertise, practice is the best path to success. Related: Top 10 Programming/Coding Interview Questions

  16. PDF GE8151- PROBLEM SOLVING AND PYTHON PROGRAMMING Question Bank

    >>>book='Problem Solving and Python Programming' >>>print(book.split()) [‗Problem', ‗Solving', ‗and', ‗Python', ‗Programing'] PART B 1. Explain the function arguments in python 2. Explain call by value and call by reference in python 3.Briefly explain about function prototypes 4. Answer the following questions. What is ...

  17. (PDF) GE3151 Python Question Bank

    ALGORITHM : Find Minimum of three numbers Step 1: Start Step 2: Read the three numbers A, B, C Step 3: Compare A,B and A,C. If A is minimum, perform step 4 else perform step 5. Step 4:Compare B and C. If B is minimum, output "B is minimum" else output "C is minimum". Step 5: Stop 3. List the building blocks of algorithm.

  18. Anna University GE 8151

    GE 8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING (Common to all branches (Regulation 2017) Time: Three hours Maximum: 100 marks Attachment Type: PDF and Images PDF Download: Click Here to Anna UniversityGE 8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING,November December 2019 Question Paper Question Paper Scanned Images Download: Previous Post

  19. Problem Solving, Python Programming, and Video Games

    1. Take a new computational problem and solve it, using several problem solving techniques including abstraction and problem decomposition. 2. Follow a design creation process that includes: descriptions, test plans, and algorithms. 3. Code, test, and debug a program in Python, based on your design. Important computer science concepts such as ...

  20. Problem Solving with Python

    Website companion for the book Problem Solving with Python by Peter D. Kazarinoff ... Review Questions Chapter 11 Python and External Hardware Chapter 11 Python and External Hardware Introduction PySerial Bytes and Unicode Strings Controlling an LED with Python Reading a Sensor with Python ...

  21. Problem Solving using Python

    Problem Solving using Python - WS 18/19. Programming requires multiple steps, from understanding the problem, designing a solution, coding, testing and debugging it into a running and correct program. Moreover, this program should be easy to understand and consequently modify. Balancing all of these concerns is a challenge for novice programmers.

  22. PDF Washington State University

    Washington State University

  23. Algorithmic problem solving in python

    Python Algorithmic Problem Solving: short important questions An algorithm should be defined clearly. An algorithm should produce at least one output. ... Algorithmic Problem Solving with Python programming or algorithmic design, Python's syntax and idioms are much easier to learn than. Get support from expert teachers. Our expert tutors can ...

  24. Algorithmic problem solving with python

    Recursion, Backtracking and Dynamic Programming in Python. An interactive version of Problem Solving with Algorithms and Data Structures using Python. ... Python Algorithmic Problem Solving: short important questions. This book uses Python to introduce folks to programming and algorithmic thinking. It is sharply focused on classical algorithms ...

  25. Week 8 Programming Assignment : Problem Solving Through Programming In

    Problem-solving through programming in C is a course of action where the students learn to apply the concepts of programming to solve problems that can be formulated as algorithms. The course primarily focuses on using the programming language C to develop algorithms and solve problems. The process involves identifying the problem, breaking it ...

  26. NPTEL Problem Solving Through Programming In C Assignment 8 Answers 2023

    Disclaimer: This answer is provided by us only for discussion purpose if any answer will be getting wrong don't blame us.If any doubt or suggestions regarding any question kindly comment. The solution is provided by Brokenprogrammers.This tutorial is only for Discussion and Learning purpose.. About NPTEL Problem Solving Through Programming In C Course: