Last active
August 19, 2019 15:25
-
-
Save namrata4/1e14e4f864240344420624b71ab1e277 to your computer and use it in GitHub Desktop.
Python Sample Questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
full_name = 'test_name' | |
def set_name(first,last): | |
full_name = first + ' ' + last | |
def get_name(): | |
return full_name | |
if __name__ == '__main__': | |
first = 'Samwise' | |
last = 'Gamgee' | |
# set name | |
set_name(first, last) | |
# print name | |
print(get_name()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
def set_name(first,last): | |
full_name = first + ' ' + last | |
def get_name(): | |
return full_name | |
if __name__ == '__main__': | |
full_name = 'test_name' | |
first = 'Samwise' | |
last = 'Gamgee' | |
# set name | |
set_name(first, last) | |
# print name | |
print(get_name()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment