Question: d e f s um di gi t s ( n ) : r = 0 w hil e n : r , n =

d e f s um di gi t s ( n ) :
r=0
w hil e n :
r , n = r + n %10, n //10
r e t u r n r
d e f c h e c k s t u d e n ti d ( s t u d e n ti d ) :
x = s um di gi t s ( s t u d e n ti d )
i f x %2==0 :
p r i n t ( v e r si o n I )
e l s e :
p r i n t ( v e r si o n I I )
p r i n t ( C o r r e c t V e r si o n o f Q2 f o r me i s : )
#c h e c k s t u d e n ti d ()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!