Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .vscode/.ropeproject/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# The default ``config.py``
# flake8: noqa


def set_prefs(prefs):
"""This function is called before opening the project"""

# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# Note that ``?`` and ``*`` match all characters but slashes.
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
# '.svn': matches 'pkg/.svn' and all of its children
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
'.hg', '.svn', '_svn', '.git', '.tox']

# Specifies which files should be considered python files. It is
# useful when you have scripts inside your project. Only files
# ending with ``.py`` are considered to be python files by
# default.
# prefs['python_files'] = ['*.py']

# Custom source folders: By default rope searches the project
# for finding source folders (folders that should be searched
# for finding modules). You can add paths to that list. Note
# that rope guesses project source folders correctly most of the
# time; use this if you have any problems.
# The folders should be relative to project root and use '/' for
# separating folders regardless of the platform rope is running on.
# 'src/my_source_folder' for instance.
# prefs.add('source_folders', 'src')

# You can extend python path for looking up modules
# prefs.add('python_path', '~/python/')

# Should rope save object information or not.
prefs['save_objectdb'] = True
prefs['compress_objectdb'] = False

# If `True`, rope analyzes each module when it is being saved.
prefs['automatic_soa'] = True
# The depth of calls to follow in static object analysis
prefs['soa_followed_calls'] = 0

# If `False` when running modules or unit tests "dynamic object
# analysis" is turned off. This makes them much faster.
prefs['perform_doa'] = True

# Rope can check the validity of its object DB when running.
prefs['validate_objectdb'] = True

# How many undos to hold?
prefs['max_history_items'] = 32

# Shows whether to save history across sessions.
prefs['save_history'] = True
prefs['compress_history'] = False

# Set the number spaces used for indenting. According to
# :PEP:`8`, it is best to use 4 spaces. Since most of rope's
# unit-tests use 4 spaces it is more reliable, too.
prefs['indent_size'] = 4

# Builtin and c-extension modules that are allowed to be imported
# and inspected by rope.
prefs['extension_modules'] = []

# Add all standard c-extensions to extension_modules list.
prefs['import_dynload_stdmods'] = True

# If `True` modules with syntax errors are considered to be empty.
# The default value is `False`; When `False` syntax errors raise
# `rope.base.exceptions.ModuleSyntaxError` exception.
prefs['ignore_syntax_errors'] = False

# If `True`, rope ignores unresolvable imports. Otherwise, they
# appear in the importing namespace.
prefs['ignore_bad_imports'] = False

# If `True`, rope will insert new module imports as
# `from <package> import <module>` by default.
prefs['prefer_module_from_imports'] = False

# If `True`, rope will transform a comma list of imports into
# multiple separate import statements when organizing
# imports.
prefs['split_imports'] = False

# If `True`, rope will remove all top-level import statements and
# reinsert them at the top of the module when making changes.
prefs['pull_imports_to_top'] = True

# If `True`, rope will sort imports alphabetically by module name instead
# of alphabetically by import statement, with from imports after normal
# imports.
prefs['sort_imports_alphabetically'] = False

# Location of implementation of
# rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general
# case, you don't have to change this value, unless you're an rope expert.
# Change this value to inject you own implementations of interfaces
# listed in module rope.base.oi.type_hinting.providers.interfaces
# For example, you can add you own providers for Django Models, or disable
# the search type-hinting in a class hierarchy, etc.
prefs['type_hinting_factory'] = (
'rope.base.oi.type_hinting.factory.default_type_hinting_factory')


def project_opened(project):
"""This function is called after opening the project"""
# Do whatever you like here!
38 changes: 38 additions & 0 deletions week_1/Assignment/assignment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Assignment # 1
## function to print a string diagonally
name = input('Enter Your Name:')
def diagonalPrint(name):
print(f'Name is: {name}')
print('\nYour name diagonaly print as: ')
for i in range(len(name)):
if(i == 0):
print(name[i])
else:
print(' '*(i-1),name[i])
diagonalPrint(name)

## function to print a string reverse diagonally
def reverseDiagonalPrint(name):
print('\nYour name reverse diagonaly print as: ')
for i in range(len(name),-1,-1):
if(i == 0):
print(name[i])
else:
print(' '*(i-1),name[i-1])
reverseDiagonalPrint(name)

# Assignment 2
## Create a program to take as input 5 student records:


# Assignment 3
## A function that will print lyrics of given song with 1 second delay between each line.
song = "Tere Jaane Ka Gam,Aur Na Aane Ka Gam, Phir Zamaane Ka Gam, Kya Karein?, Meri Dehleez Se Hokar, Bahaarein Jab Gujarti Hai, Yahan Kya Dhup Kya Saawan, Hawayein Bhi Barashti Hai, Hume Puchhon Kya Hota Hai, Bina Dil Ke Jiye Jaana, Bahot Aayi Gayi Yaadein, Magar Iss Baar Tum Hi Aana"
def printSong(song):
import time
songparagraph = song.split(', ')
print('Your Song is:')
for i in range(len(songparagraph)):
print(songparagraph[i])g
time.sleep(1)
printSong(song)
53 changes: 53 additions & 0 deletions week_1/Assignment/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Assignments

1. Define a function to print a string diagonally, for example:

Tarun will be printed as:

![https://s3.us-west-2.amazonaws.com/secure.notion-static.com/ba165be3-eab3-43f3-9399-211180238841/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20201206%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20201206T191214Z&X-Amz-Expires=86400&X-Amz-Signature=b85fda20d735dfdfd9ebfd409d440d93bed5391ad5ca4bd1dc594c30fd616c35&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/ba165be3-eab3-43f3-9399-211180238841/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAT73L2G45O3KS52Y5%2F20201206%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20201206T191214Z&X-Amz-Expires=86400&X-Amz-Signature=b85fda20d735dfdfd9ebfd409d440d93bed5391ad5ca4bd1dc594c30fd616c35&X-Amz-SignedHeaders=host&response-content-disposition=filename%20%3D%22Untitled.png%22)

Optional (recommended):

- Try printing reverse diagonal as well.


### Solution
- for printing characters diagonaly i create a loop which have range of user input then i add spaces at each itration then the character of user input


<br>
2. Create a program to take as input 5 student records in the following format:

```
**roll_num** | **name** | **age** | **marks**(out of 100)
```

And then output the records in a tabular form with class average, class highest and class lowest at end in the following format.

- Use dictionaries (list of dictionaries in exact)
- Insert atleast 5 records
- Input must be user-given
- (Optional) validate the user input, i.e marks aren't greater 100 and other such validations you think there might be

### Not completed

<br>
<br>


3. A function that will print lyrics of given song with 1 second delay between each line.

- Use time.sleep()
- Use split() function of string

### Solution
-store a song in a song variable then split it at every part which has , then print all the parts at 1 sec delay

<br>
Note:

- You can use main function to predefine anything but make sure you divide everything you can in functions.
- Submit your github folder link and your output on Google Classroom
- Make sure you fork [https://github.com/sinnytk/Python-Bootcamp-DSC-DSU](https://github.com/sinnytk/Python-Bootcamp-DSC-DSU), clone the repo locally and create your scripts in the respective week's folder and push it.
- Make sure in each folder there's a [readme.md](http://readme.md) file with code output and brief explanation of what you did and why you did it (not necessary, but good practice)

Binary file added week_1/__pycache__/Day2_1.cpython-39.pyc
Binary file not shown.
116 changes: 116 additions & 0 deletions week_1/day2/day 2 pthon bootcamp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/usr/bin/env python
# coding: utf-8

# In[17]:


x = 7
def func():
global x
a = x
a = a * 8

print(a)
func()
print(x)


# In[18]:


print("My name is {} I am From {}".format("Shahab","Faislabad"))


# In[20]:


a = 'pagal'
print(f'hell wajeeha {a}')


# In[21]:


x = input('Enter your Name:')


# In[22]:


x


# In[23]:


x = "87";


# In[24]:


int(x)


# In[25]:


x


# In[26]:


a , b = 8 ,9


# In[28]:


a , b


# In[29]:


a , b = b , a


# In[30]:


a , b


# In[32]:


for i in range (1,100,2):
print(i,end=' ')


# In[33]:


row = 7


# In[39]:


for i in range(row):
for j in range(i):
print("* ",end=' ')


# In[40]:


print "hello"


# In[ ]:




10 changes: 10 additions & 0 deletions week_1/day3/Day3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Make Exponent of a number
def exponent(num,expo):
return int(num) ** int(expo)


number = input('Enter a number: ')
exponent2 = input('Enter a Exponenet: ')
print(exponent(number,exponent2))


34 changes: 34 additions & 0 deletions week_1/day3/Day3_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Understanding the Scopes

def alo():
# it will make a variable a in local scope of this function
# a = 20
global a
# glabal tell the funstion the a you will be refrening will be global a
a = a * 10
print(f'funstion1 {a} {b}')

def alo2():
print(f'function2 {a} {b}')

a = 2
b = 3

# __name__
# The __name__ variable (two underscores before and after) is a special Python variable. It gets its value depending on how we execute the containing script.
# When a Python interpreter reads a Python file, it first sets a few special variables. Then it executes the code from the file.
# when the interpreter runs a module, the __name__ variable will be set as __main__ if the module that is being run is the main program. But if the code is importing the module from another module, then the __name__ variable will be set to that module’s name.

def myFunction():
print('The value of __name__ is ' + __name__)

def main():
myFunction()
alo()
alo2()

# Now the problem is when i import this file in Day3_2.py if my function are globaly calling each they will call them there too thats we use this

if __name__ == "__main__":
main()
# now it will only call the function in this file make complications less
Loading