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

Python String and Number Tasks

The document contains solutions for three programming tasks. Task #01 reverses a string and counts the number of vowels, Task #02 determines if a number is even or odd, and Task #03 sorts a list of numbers provided by the user. Each task includes relevant code snippets for implementation.

Uploaded by

mzh2652
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)
5 views1 page

Python String and Number Tasks

The document contains solutions for three programming tasks. Task #01 reverses a string and counts the number of vowels, Task #02 determines if a number is even or odd, and Task #03 sorts a list of numbers provided by the user. Each task includes relevant code snippets for implementation.

Uploaded by

mzh2652
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

Assignment 01

Name:Nazakat Ali
ID:nazakatalinwl@[Link]

Solution of Task #01

input_string=input("Enter Your String here:")


reversed_string=input_string[::-1]
print("The String in Reverse order:",reversed_string)
vowels="aeiouAEIOU"
vowels_count=0
for char in input_string:
if char in vowels:
vowels_count+=1
print("The Number of Vowels in the String:",vowels_count)

Solution of Task #02

input_number=int(input("Enter Your Number here:"))


if input_number%2==0:
print("The Number is Even")
else:
print("The Number is Odd")

Solution of Task #03

user_input = input("Enter a list of numbers separated by commas: ")


int_list = [int([Link]()) for num in user_input.split(",")]

import numpy as np
import sys
sorted_list = [int(i) for i in [Link](int_list)]
print("Sorted list:", list(sorted_list))

You might also like