Correct the order of variables in the formatted string and fix the output of the isdigit() method in Day 4 - Strings of 30 Days of Python challenge

This commit is contained in:
Akira 2026-03-29 02:15:48 +03:30
parent c65d0e583d
commit 1abcf7e620

View File

@ -359,7 +359,7 @@ last_name = 'Yetayeh'
age = 250
job = 'teacher'
country = 'Finland'
sentence = 'I am {} {}. I am a {}. I am {} years old. I live in {}.'.format(first_name, last_name, age, job, country)
sentence = 'I am {} {}. I am a {}. I am {} years old. I live in {}.'.format(first_name, last_name, job, age, country)
print(sentence) # I am Asabeneh Yetayeh. I am 250 years old. I am a teacher. I live in Finland.
radius = 10
@ -433,7 +433,7 @@ print(challenge.isdecimal()) # False
challenge = '123'
print(challenge.isdecimal()) # True
challenge = '\u00B2'
print(challenge.isdigit()) # False
print(challenge.isdigit()) # True
challenge = '12 3'
print(challenge.isdecimal()) # False, فاصله مجاز نیست
```