Get link Facebook X Pinterest Email Other Apps April 11, 2022 EVEN NUMBER IN THE LIST# Python program to print Even Numbers in a List# list of numberslist1 = [10, 21, 4, 45, 66, 93]# iterating each number in listfor num in list1: # checking condition if num % 2 == 0: print(num, end=" " Get link Facebook X Pinterest Email Other Apps Comments
April 19, 2022 class and object class Person: def __init__ ( self , name , age): self .name = name self .age = age def myfunc ( self ): print ( "Hello my name is " + self .name) p1 = Person( "John" , 36 ) p1.myfunc() Read more
March 29, 2022 WHILE LOOP➰ i = 1 while i <= 10 : print (i) i += 1 print ( "done with loop" ) Read more
March 31, 2022 CLASSES AND OBJECT class Student: def __init__ ( self , name , major , gpa , is_on_probation): self .name = name self .major = major self .gpa = gpa self .is_on_probation = is_on_probation IN APP.PY FILE from Student import Student student1 = Student( 'Utkarsh' , "Business" , 9.9 , False ) print (student1.name) OUTPUT= utkarsh Read more
Comments
Post a Comment