For the first day of the course outline, the left for the understanding of the section, the right needs to focus on and practice (hand-hit).
Exercises:
- using while loop input 1 2 3 4 5 6 8 9
1 count=12 while count<11: 3 print (count) 4 if count ==6: 5 count +=16 print ( " " Span style= "COLOR: #000000" >) 7 count +=18< /span>
loop output
- the sum of all the numbers for 1-100 and
1 count = 12 sum =< Span style= "COLOR: #000000" > 0 3 while count<101: 4 sum= sum + count 5 count= count + 16 print (sum)
1-100 all numbers and
- all odd numbers in output 1-100
1 count=12 while count<101: 3 4 print
(count) 5 count +=2
output 1-100 all odd numbers
- all even in output 1-100
1 count=0 2 while count<101 : 3 4 print
(count) 5 count +=2
all even in output 1-100
- Beg 1-2+3-4+5 ... 99 of all numbers of the and
1 sum=02 i=03 while i<100:4 if i%2==0:5 Sum-=i6 else:7 sum + =I8 i +=19print(sum)
Beg 1-2+3-4+5 ... 99 of all numbers of the and
- User Login (three chance retry)
1t=02 whileT<3:3Show=input ("please start your show! ")4Dream=input ("What do you have in your dreams? ")5 ifShow = ="poping":6 ifdream=="Dancer":7 Print("give the towel, get the championship together.")8 Break 9 Else:Ten Print("your dream is a little floating.") OneT +=1 A Else: - Print("Sorry, you're not good enough.") -T +=1 the ifT==3: - Print("Battle three times, sorry!") -
User Login (three chance retry)
Day1-python Foundation