UCEST 105 Lab Cycle - 2
Learning outcome:
Write looping statements while, for
Learn transfer control statements break , continue
Learn to process strings
1.Find the largest, smallest, sum and average of 'n' numbers. ( use while loop)
2.Print the series 1 2 4 7 11 16 22.........n ( use while loop)
2.Print the following series using for loop ( learn range() function)
1 3 5 7 9 11 13...n
50 45 40 35 30 25 20 15 10 5 0
3.Find the numbers between 10 and 1000 that are divisible by 13 but not divisible by 3( use for)4.Generate Fibonacci Series 0 1 1 2 3 5 8...n ( use while loop)
5.Print the factorial of a number. ( use for)
6.Print the factors of a number. ( use for)
7.Find the sum of the digits of a number. ( use while)
8.Check whether the given number is a Krishnamurti number( Krishnamurthy Number: It is a number which is equal to the sum of the factorials of all its digits.Use factorial() function from math module.For example : 145 = 1! + 4! + 5! = 1 + 24 + 120 = 145).
9.Check whether the given number is Prime or not ( learn break statement)
10.Check whether the given 3 digit number is an Armstrong number. (use while Eg:153,370,371,407)
(1^3+5^3+3^3=1+125+27=153)
11.Read N numbers and find the sum of all odd and even numbers separately.
12.Count number of vowel characters in a string.
13.Remove all vowel characters from a string.
14.Count number of letters , digits, words, uppercase and lower case letters in a string15.Assume that the variable data refers to the string "Python rules!". Use string methods to perform the following tasks.
a.Convert the string to uppercase.
c. Locate the position of the string "rules" .
d. Replace the exclamation mark with a question mark.
c. Locate the position of the string "rules" .
d. Replace the exclamation mark with a question mark.
16.Decimal to binary and binary to decimal conversion. ( read the binary number as string.Do not use built-in functions)
17.Write a python program to find the sum of the cosine series 1 - x^2/2! + x^4/4!-...n. Read n.Factorial can be computed using math module ( be familiar with other series also eg: sin(x), e^(x))
Note: for Qnos:3,4,5,6,7 write the algorithm , flowchart and pseudo code
Comments
Post a Comment