ICP2 - PallaviArikatla/Python GitHub Wiki

TITLE: Working on Loops, List, Tuples, Functions in python.

Software Required: Pycharm, python 3/ python 2/ Anaconda.

**QUESTION 1: Write a program, which reads weights (lbs.) of Nstudents into a list and convert these weights to kilograms in a separate list using:

  1. Loops and
  2. List comprehensions**

Read number of students, read individual student's weight and append all students into created list. Then convert these weights into kilograms and put them into another list.

QUESTION 2: Write a program that returns every other char of a given string starting with first using a function named “string_alternative”.

Create main function and read the given input. Create a method "string_alternative" and pass the input. Using string slice print alternative characters.

QUESTION 3: Write a python program to find the wordcountin a file for each line and then print the output.Finally store the output back to the file.

Provide an input file which needed to be counted, then a new file will be created and the wordcount will be performed as follows.