Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

1Usei' Dashboa rd IPru X <+ Prutor X

t" l+ -======================:ri~•······· ···


Online Python Comp,Ti leierl(frlnt cte~rp,prcxl - =~
C ii python.prutor.ai/editor/1139707

ESC101 File Run Help -1 CodeBook / Practice 0 Scratchpad

Solution .py Python v v5. py v4 PY v3.py v2 .py v1 PY

1 c har = input ( "Enter a char \n " )


2 ~ if c har in ( 'a' , e , 1 , 'o • 'u' ):
ow to attemP-t this coding.11uestion? 3 print ( "Given character is a vm,,el" )
1. Write your answer code within the editor area on the right 4 ~ else:
2. Do Not write the main method and Do Not change the function name 5 print("Given character is a consonant" )
3. To compile/execute the program , Click C&E
4. If you want to run your code with any input valµes , Use menu Ruh =>
Evaluate (click evaluate button)
5 Result will be display in Output tab

Problem :591
Problem Statement

consonant

# The required output is•.


Enter a char
Given character is a vowel

Q Type hei:e to search


➔ C ii python.prutor.ai/editor/1143802

TS ESC101 File Run Help lil CodeBook .,· Practice 0 Scratchpad

Soluti~ _py Python v v5 .py v4 PY v3.py v2 PY v1 .py

\\; um=0
~rint ( "The first n positive
How to attempt this coding_guestion?
~or i in range(1 , 100) :
1. Write your answer code within the editor area on the right
sum=sum+ i
2 Do Not write the main method and Do Not change the function name if sum>100 :
3. To compile/execute the program , Click C&E break
4 . If you want to run your code with any input values , Use menu Run => print (i , end =' ')
Evaluate (click evaluate button) print ( "Sum of the numbers " , sum- i)
5. Result will be display in Output tab

Problem :603
Problem State1T1ent

Wnte a simple python program to print and add number


till the sum of them is less than 100

# The required output is as


The first n positive numbers having the total sum less tl1an 100 are
1 2 3 4 5 6 7 8 9 1o 11 12 13 Sum of the numbers= 91

_p Type hei:e to search J],


elcom~ j Oser Dashboard j Pru X '<r Prutor x ~ OnlTnePytl'ion c ompiler(lnt~ -

C ii python.prutor.ai/editor/1147897

; ESC101 File Run Help liil CodeBook ,,· Practice 0 Scratchpad

Solution.py Python v v 5 .py v4 .py v 3.py v2 .py v1 .py

~ change this value for a different output


by_str = 'level '
I-l ow to attemRt this coding_Question? r rint("Given string is= " ,my_str)
1. Write your answer code within the editor area on the right # make it suitable for caseless comparison
2 . Do Not write t he main method and Do Not change the function name ~y_s tr = my_str.casefold()
3 . To compile/execute the program . Click C&E
4 If you w ant to run your code with any input values , Use menu Run = > 7 r reverse the string
Evaluate (click eva luate button) 8
5 . Result will be d isplay in Output tab 9 # check i~ the string is equal to its reverse
10 · if my_str[: :-1]:
11 print("It is palindrome" )
12 • else :
Prob lem :2400 13 print(''It is not palindrome" )
P roblem Statement

F ind whether a string is a palindrome or not

Expected output ·
G iven string is= level
It is palindrome

~O1tput ► C&E Time Left .

ytho".prutor a i edito· / 1 l .!-39~

IQ Type hei:e to search


pyt on.prutor.ai/editor/11 51992

·s ESC101 File Run Help


iii Cod eBook / Practice Qi Scratchpad

Solulion .py Python "' v5 PY v4 PY v3 PY v::> PY

1 b yli st = []
How to attemP-t this coding_i:iuestion? 2T for i in range(1,11):
1 Write your answe r code within the editor area on the right 3 myli st .append(5 *i )
2 . Do Not wnte the mam method and Do Not change the function name 4 print ( "First 10 multiple of 5 =" )
3 . To compile/execute the program Cilek C&E
5 print( myli st )
4 If you w ant to run your code with any input values , Use menu Run =>
Evaluate (click evaluate button)
5 Result will be display in Output tab

Probl em :24 79
Problem Statement

WAP to generate a list o' 1 0 starting multiple of 5 using list comprehension


method

Required output"
First 1 0 multiple of 5 =
[5 , 10 15 20 , 25 30 35 40 45 50)
mco11so1e [5I AcllVlty LOC! [j lrput .-.outp·t ► . 11 I •

a Q Type heFe to sea rch


• Welcome I User Da s hboard I Pn , X <• Prute r X ~ Onl ine Python Compiler (lnterpr X +
'- python.prutor.a1/ed1to r/ 11 560 87

~ ITS ESC101 File Run Help lii1 CodeBook -✓• Practice 0 Scratchpad

Solution py Python v vS PY v4 PY v3 PY v2 PY v1 .py

1 num= [1 5 ,14, 50 , 21 , 34 , 28 , 98 ]
2 print ( "Given list is =" ,num)
How to attempt this coding__g uestion ? 3 j = [num for num in n um if num % 2 != 0]
1 Wri te your answer code w1th111 the editor area on the right 4
2 •o Not \\ te the main method and C'o Not change the function name 5 pr·int("After r·emoving even numbers from list = ")
3 To comp1l e,e,ecute the program , Cilek C&E 6 print(j)
I: -t If vou want to run vour code with any mput values, Use menu Run => 1
m
Evaluate tcl1ck evaluate button)
5 Result \\ 111 be d1splav 111 Output tab

.J Problem :3083
Problem Statement

Wnte a Pvthon program to removmg e\·en numbers from given 11st usmg list
comprehension \list 1s g1\ en belov.)

num = [15 1-t 50 21 34 28 98)

E:--.pected output
Given list 1s = [ "5. 1-t 50 2 1 34 28 98]
After · emqvmg e\ en nur,bers fro111 ' st = • console [') Ip \. ' I L

[15 21]

Q Tvpe hei:e to sea rch J1

You might also like