Learning Python-Basic course: Day 9, Summary of the week and exercises.

Today, we will look at the whole week’s summary and check out some more questions. The solution to the Day 7 coding challenge is also provided.

Summary of the week-

Day 6- We learnt about the while loop, while-else and solved q…


This content originally appeared on DEV Community and was authored by Aatmaj

Today, we will look at the whole week's summary and check out some more questions. The solution to the Day 7 coding challenge is also provided.

Summary of the week-

Day 6- We learnt about the while loop, while-else and solved questions

Day 7- We solved some more exciting questions on the for and while loop, and the coding challenge whose solution is presented today.

Day 8- We learnt about Unicode in Python and solved some questions.

Sample questions-

1) Password generator. Write a sample program to input a number and output a 6 Unicode-character password. Divide the number by numbers 1-7 and generate characters using the result.

a=int(input("Please enter a 6 digit number "))
for i in range(1,7):
    print(chr(a//i),end="")

Output-

Please enter a 6 digit number 1293748 
?ﲯ꡴繗攒吺

You can find the unicode chart here

2) Write code to give the following output-

A
ABA
ABCBA
ABCDCBA

Answer-

for j in range(1,5):
 for i in range(1,j+1):
    print(chr(i+64),end="")
 for i in range(-j+1,0):
    print(chr(-i+64),end="")
 print()

Exercise-
1) Write a program to get 5 characters from user, take its Unicode sum and display the corresponding character for Unicode value. Answer

Please enter a character A
Please enter a character A
Please enter a character T
Please enter a character M
Please enter a character A
Please enter a character J
Please enter a character -
Answer is  Ǜ

2) Modify the password generator to include only keyboard characters (Unicode 33 to 126)
OUTPUT-

Please enter a 6 digit number 135689
#P@gk0

Answer

Solution to the coding challenge.

a=1
n=0
while True:
 if(a>=50):
     break
 n=n+1
 for i in range(0,n):
    for j in range(0,n):
        print(a,end=",")
    if(a>=50):
     break
    a=a+1 

✌️So friends that's all for now. ? Hope you all are having fun.? Please let me know in the comment section below ?. And don't forget to like the post if you did. ? I am open to any suggestions or doubts. ? Just post in the comments below or gmail me. ?
Thank you all?

For those who have not yet made account in Dev.to, you can have a free easy sign-up using your mail or GitHub accounts. I would suggest the budding developers to create your GitHub free account right away. You would require to register sooner or later anyways

???????????????????????????????
Next day will begin from Tuesday?, Monday is reserved for.... MATLAB MONDAYS? Follow me for updates...


This content originally appeared on DEV Community and was authored by Aatmaj


Print Share Comment Cite Upload Translate Updates
APA

Aatmaj | Sciencx (2021-07-03T06:38:43+00:00) Learning Python-Basic course: Day 9, Summary of the week and exercises.. Retrieved from https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/

MLA
" » Learning Python-Basic course: Day 9, Summary of the week and exercises.." Aatmaj | Sciencx - Saturday July 3, 2021, https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/
HARVARD
Aatmaj | Sciencx Saturday July 3, 2021 » Learning Python-Basic course: Day 9, Summary of the week and exercises.., viewed ,<https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/>
VANCOUVER
Aatmaj | Sciencx - » Learning Python-Basic course: Day 9, Summary of the week and exercises.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/
CHICAGO
" » Learning Python-Basic course: Day 9, Summary of the week and exercises.." Aatmaj | Sciencx - Accessed . https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/
IEEE
" » Learning Python-Basic course: Day 9, Summary of the week and exercises.." Aatmaj | Sciencx [Online]. Available: https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/. [Accessed: ]
rf:citation
» Learning Python-Basic course: Day 9, Summary of the week and exercises. | Aatmaj | Sciencx | https://www.scien.cx/2021/07/03/learning-python-basic-course-day-9-summary-of-the-week-and-exercises/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.