Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views1 page

Exercise 4

Uploaded by

Shailvi Suman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Exercise 4

Uploaded by

Shailvi Suman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSIR12 Introduction to computer programming

B.Tech Civil Engineering, Section A


Date: 1st Mar 2024
Exercise 4: Nested Loop and String Methods

Write Algorithms and execute the following programs.


1. Write a python program to print 1 to 10 multiplication table using Nested Loop.
2. Write a program to print the following with single space in-between characters,
a) *
* *
* * *
* * * *
* * * * *
b) *
* *
* * *
* * * *
3. Write a program to print the following with single space in-between characters
a) 1
12
123
1234
b) 1
22
333
4444
4. Write a program to get a string input and then display number of characters in the string,
last (or max) index value and character in the string.
5. Write a program to display the odd index value and the corresponding characters in the
string (Example: for string “Hello”, the odd indexed value is 1,3 (max index for Hello is 4) and
display the corresponding characters ‘e’ and ‘l’)
a) Python developers
b) Introduction to computer programming
6. Find the no. of times a letter ‘h’ occurs in a text, “happy hour”.
7. Find the index of the second occurrence of the letter h in the above text.
8. Find the index of third occurrence of e in ‘Developers’.

You might also like