mirror of
https://github.com/Asabeneh/30-Days-Of-Python.git
synced 2026-06-03 21:02:42 +08:00
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:
parent
c65d0e583d
commit
1abcf7e620
@ -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, فاصله مجاز نیست
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user