Question 17 - Week 4 Practice | Prasnya
Prasnya
Continue with Google
Practice path
Dashboard
Exam
Qualifier / Quiz 1
Go to subject
Programing with python
Go to chapter
Week 4
Question 17
00:00
Est. 2 min
Marks:
+4.00
0.00
Select an appropriate code snippet that can shift the given key `zanzamsayzam` by two places along the alphabet and generate the encrypted key.
Single correct
Medium Difficulty
16 July 2023
A
``` alphabet = 'abcdefghijklmnopqrstuvwxyz' key = 'zanzamsayzam' encrypt_key = '' for i in key: encrypt_key = encrypt_key + alphabet[((alphabet.index(i)) + 2) % 0] print(encrypt_key) ```
B
``` alphabet = 'abcdefghijklmnopqrstuvwxyz' key = 'zanzamsayzam' encrypt_key = '' for i in key: encrypt_key = encrypt_key + alphabet[((alphabet.index(i)) + 2) % 25] print(encrypt_key) ```
C
``` alphabet = 'abcdefghijklmnopqrstuvwxyz' key = 'zanzamsayzam' encrypt_key = '' for i in key: encrypt_key = encrypt_key + alphabet[((alphabet.index(i)) + 2) // 26] print(encrypt_key) ```
D
``` alphabet = 'abcdefghijklmnopqrstuvwxyz' key = 'zanzamsayzam' encrypt_key = '' for i in key: encrypt_key = encrypt_key + alphabet[((alphabet.index(i)) + 2) % 26] print(encrypt_key) ```