go-python / go-python/gpython

Implement string format method

Open
#116 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
1k
Forks
105
PR merge metrics
No merged PRs in 30d

Description

## python
```
>>> a = 'alpha'
>>> b = 'bravo'
>>> d = 'delta'
>>> origin = '{} {} charlie {}'
>>> new = origin.format(a, b, d)
>>> print(new)
alpha bravo charlie delta
>>> print(origin)
{} {} charlie {}
>>>
```

## gpython
```
>>> a = 'alpha'
>>> b = 'bravo'
>>> d = 'delta'
>>> origin = '{} {} charlie {}'
>>> new = origin.format(a, b, d)
Traceback (most recent call last):
File "", line 1, in
FIXME line of source goes here
AttributeError: "'str' has no attribute 'format'"
>>> print(new)
Traceback (most recent call last):
File "", line 1, in
FIXME line of source goes here
NameError: "name 'new' is not defined"
>>> print(origin)
{} {} charlie {}
>>>
```

Attribute error occured using string.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.