Programs 2023
Programs 2023
Program:
Output:
Program 2
Q2. Input two numbers and display the larger / smaller number.
Program:
Output:
Program 3
Q3. Input three numbers and display the largest / smallest number.
Program:
Output:
Program 4
Program:
Output:
Program 5
Q6. Generate the patterns using nested loop.
* *
* * *
* * * *
* * * * *
Program:
Output:
Program 6
Q6. Generate the series.
𝟏 𝟏 𝟏 𝟏
𝒔𝒆𝒓𝒊𝒆𝒔 = 𝟏 + + 𝟐 + 𝟑 +⋯+ 𝒑
𝒏 𝒏 𝒏 𝒏
Program:
Output:
Program 7
Program:
Output:
Program 8
Program:
Output:
Program 9
Program:
Output:
Program 10
Program:
Output:
Program 11
Q11. Count and display the number of vowels, consonants,
uppercase, lowercase characters in string.
Program:
Output:
Program 12
Q12. Input a string and determine whether it is a palindrome or
not; convert the case of characters in a string.
Program:
Output:
Program 13
Q13. Write a program that prompts for a phone number of 10 digits
and two dashes, with dashes after the area code and the next three
numbers. For example, 017-555-1212 is a legal input. Display if the
phone number entered is valid format or not and display if the
phone number is valid or not (i.e., contains just the digits and dash
at specific places.)
Program:
Output:
Program 14
Q14. Write a Python program to count the number of words in a
string. Also count the number of words that starts with vowels.
Program:
Output: